mirror of
https://github.com/cyberarm/i-mic-rts.git
synced 2025-12-15 15:52:34 +00:00
Tanks turret is now centered on its body
This commit is contained in:
@@ -18,7 +18,7 @@ class IMICRTS
|
||||
attr_reader :player, :id, :name, :type, :speed
|
||||
attr_accessor :position, :angle, :radius, :target, :state,
|
||||
:movement, :health, :max_health,
|
||||
:turret
|
||||
:turret, :center
|
||||
def initialize(name:, player:, id:, position:, angle:, director:)
|
||||
@player = player
|
||||
@id = id
|
||||
@@ -30,6 +30,7 @@ class IMICRTS
|
||||
@radius = 32 / 2
|
||||
@target = nil
|
||||
@state = :idle
|
||||
@center = CyberarmEngine::Vector.new(0.5, 0.5)
|
||||
|
||||
@components = {}
|
||||
|
||||
@@ -109,7 +110,7 @@ class IMICRTS
|
||||
|
||||
def draw
|
||||
render unless @render
|
||||
@render.draw_rot(@position.x, @position.y, @position.z, @angle)
|
||||
@render.draw_rot(@position.x, @position.y, @position.z, @angle, @center.x, @center.y)
|
||||
|
||||
component(:turret).draw if component(:turret)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user