Module: MSK::Actions::Movement

Included in:
MSK::ActionDSL
Defined in:
lib/project/actions/movement.rb

Instance Method Summary collapse

Instance Method Details

#duration_path(path, duration = 0.25, offset = true, orient = true) ⇒ Object



23
24
25
# File 'lib/project/actions/movement.rb', line 23

def duration_path(path, duration=0.25, offset=true, orient=true)
  SKAction.followPath(path, asOffset: offset, orientToPath: orient, duration: duration)
end

#move_by(delta, duration = 0.25) ⇒ Object



7
8
9
# File 'lib/project/actions/movement.rb', line 7

def move_by(delta, duration=0.25)
  SKAction.moveBy(delta, duration: duration)
end

#move_by_delta(x, y, duration = 0.25) ⇒ Object



11
12
13
# File 'lib/project/actions/movement.rb', line 11

def move_by_delta(x, y, duration=0.25)
  SKAction.moveByX(x, y: y, duration: duration)
end

#move_to(location, duration) ⇒ Object



3
4
5
# File 'lib/project/actions/movement.rb', line 3

def move_to(location, duration)
  SKAction.moveTo(location, duration: duration)
end

#move_to_x(x, duration = 0.25) ⇒ Object



15
16
17
# File 'lib/project/actions/movement.rb', line 15

def move_to_x(x, duration=0.25)
  SKAction.moveToX(x, duration: duration)
end

#move_to_y(y, duration = 0.25) ⇒ Object



19
20
21
# File 'lib/project/actions/movement.rb', line 19

def move_to_y(y, duration=0.25)
  SKAction.moveToY(y, duration: duration)
end

#speed_path(path, speed = 1.0, offset = true, orient = true) ⇒ Object



27
28
29
# File 'lib/project/actions/movement.rb', line 27

def speed_path(path, speed=1.0, offset=true, orient=true)
  SKAction.followPath(path, asOffset: offset, orientToPath: orient, speed: speed)
end