mirror of
https://github.com/cyberarm/i-mic-rts.git
synced 2025-12-15 15:52:34 +00:00
Added building component, refactored components to have setup, draw, update and tick methods, added fencing for building construction area parimeter, misc other changes.
This commit is contained in:
@@ -1,8 +1,13 @@
|
||||
class IMICRTS
|
||||
class Movement < Component
|
||||
attr_accessor :pathfinder
|
||||
def initialize(parent:)
|
||||
@parent = parent
|
||||
|
||||
def update
|
||||
if pathfinder && pathfinder.path_current_node
|
||||
rotate_towards(pathfinder.path_current_node.tile.position + @parent.director.map.tile_size / 2)
|
||||
end
|
||||
|
||||
follow_path
|
||||
end
|
||||
|
||||
def rotate_towards(vector)
|
||||
|
||||
Reference in New Issue
Block a user