Method: Actor#collision_with

Defined in:
lib/fantasy/actor.rb

#collision_withArray, String

Array of strings (or "all"). Represents with which other solid Actors this Actor collide.

Default "all".

Examples:

Set with which other Actors this Actor is colliding:

actor = Actor.new("image")
actor.collision_with = ["enemy", "bullet"]

Set this Actors collides with all other Actors

actor = Actor.new("image")
actor.collision_with = "all"

Returns:

  • (Array, String)

    the actual list of names of Actors to collide with



218
219
220
# File 'lib/fantasy/actor.rb', line 218

def collision_with
  @collision_with
end