Class: Chingu::AsyncTasks::Move

Inherits:
Tween show all
Defined in:
lib/chingu/async_tasks/move.rb

Overview

Syntactic sugar for tween(duration, :x => x, :y => y, :angle => angle)

Instance Method Summary collapse

Methods inherited from Tween

#finished?, #update

Methods inherited from Chingu::Async::BasicTask

#finished?, #update

Constructor Details

#initialize(duration, x, y, angle = nil) ⇒ Move



32
33
34
35
36
37
38
39
40
# File 'lib/chingu/async_tasks/move.rb', line 32

def initialize(duration, x, y, angle = nil)
  properties = { }
  
  properties[:x]     = x unless x.nil?
  properties[:y]     = y unless y.nil?
  properties[:angle] = angle unless angle.nil?
  
  super(duration, properties)
end