Method: Actor#gravity

Defined in:
lib/fantasy/actor.rb

#gravityFloat

Note:

The the direction will be Coordinates.down

Controls constant force this Actor will receive on each frame.

Default 0.

Examples:

Set gravity

actor = Actor.new("image")
actor.gravity = 10

Returns:

  • (Float)

    the actual gravity



135
136
137
# File 'lib/fantasy/actor.rb', line 135

def gravity
  @gravity
end