Class: Core::Game::MotionGoal

Inherits:
Goal show all
Defined in:
lib/game/npc/goal.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Goal

#restart, #setup

Constructor Details

#initialize(dx, dy, x, y) ⇒ MotionGoal

Returns a new instance of MotionGoal.



27
28
29
30
31
# File 'lib/game/npc/goal.rb', line 27

def initialize(dx, dy, x, y)
  super()
  @dx, @dy = dx, dy
  @x, @y = x, y
end

Instance Attribute Details

#dxObject (readonly)

Returns the value of attribute dx.



25
26
27
# File 'lib/game/npc/goal.rb', line 25

def dx
  @dx
end

#dyObject (readonly)

Returns the value of attribute dy.



25
26
27
# File 'lib/game/npc/goal.rb', line 25

def dy
  @dy
end

#stateObject

Returns the value of attribute state.



26
27
28
# File 'lib/game/npc/goal.rb', line 26

def state
  @state
end

#xObject (readonly)

Returns the value of attribute x.



25
26
27
# File 'lib/game/npc/goal.rb', line 25

def x
  @x
end

#yObject (readonly)

Returns the value of attribute y.



25
26
27
# File 'lib/game/npc/goal.rb', line 25

def y
  @y
end

Instance Method Details

#recalcObject



32
33
34
# File 'lib/game/npc/goal.rb', line 32

def recalc
  @state = :recalc
end