Skip to content

feature: contrasting shot. #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion lib/scorched_earth/renders/trajectory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.awt.Color
import java.awt.BasicStroke
import java.awt.geom.GeneralPath
import java.awt.geom.AffineTransform

module ScorchedEarth
module Renders
Expand All @@ -16,6 +17,7 @@ def initialize(trajectory)
def call(graphics, *_args)
height = graphics.destination.height
path = GeneralPath.new GeneralPath::WIND_NON_ZERO
transform = AffineTransform.new
first, *remaining = trajectory

path.move_to first[0], height - first[1]
Expand All @@ -25,9 +27,15 @@ def call(graphics, *_args)
end

graphics.set_stroke BasicStroke.new 3.0, BasicStroke::CAP_ROUND, BasicStroke::JOIN_ROUND, 10.0, [10.0].to_java(:float), 0.0
graphics.set_color Color::WHITE
graphics.set_color Color::LIGHT_GRAY


graphics.draw path

transform.translate 2, 1
path.transform transform
graphics.set_color Color::WHITE
graphics.draw path
end
end
end
Expand Down