mirror of
https://github.com/cyberarm/i-mic-rts.git
synced 2025-12-15 15:52:34 +00:00
Added construction complete order, added jeep overlay image to show windscreen, added rotors component for helicopter; more work needed, replaced all build and vehicle assets with ones that are 6x larger to prevent pixelization when zoomed in, misc.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
class IMICRTS
|
||||
class Turret < Component
|
||||
attr_accessor :angle, :center
|
||||
|
||||
def setup
|
||||
@angle = 0
|
||||
@center = CyberarmEngine::Vector.new(0.5, 0.5)
|
||||
@@ -19,16 +20,18 @@ class IMICRTS
|
||||
end
|
||||
|
||||
def render
|
||||
@render = Gosu.render(32, 32, retro: true) do
|
||||
@body_image.draw(0, 0, 0) if @body_image
|
||||
@shell_image.draw_rot(0, 0, 0, 0, 0, 0, 1, 1, @parent.player.color) if @shell_image
|
||||
@overlay_image.draw(0, 0, 0) if @overlay_image
|
||||
image = @shell_image || @body_image || @overlay_image
|
||||
|
||||
@render = Gosu.render(image.width, image.height, retro: true) do
|
||||
@body_image&.draw(0, 0, 0)
|
||||
@shell_image&.draw_rot(0, 0, 0, 0, 0, 0, 1, 1, @parent.player.color)
|
||||
@overlay_image&.draw(0, 0, 0)
|
||||
end
|
||||
end
|
||||
|
||||
def draw
|
||||
render unless @render
|
||||
@render.draw_rot(@parent.position.x, @parent.position.y, @parent.position.z, @angle, @center.x, @center.y)
|
||||
@render.draw_rot(@parent.position.x, @parent.position.y, @parent.position.z, @angle, @center.x, @center.y, @parent.scale.x, @parent.scale.y)
|
||||
end
|
||||
|
||||
def update
|
||||
|
||||
Reference in New Issue
Block a user