Gládio Cítrico

Ramu 0.7b doc

doc homeRamu

virtual Collisor.onCollision()

Description

Triggered when a collisor is colliding with it.

You can test this snippet of code here.

let enemy = new Collisor(1, 4, 5, 5);
enemy.tag = 'enemy';

class NewObj extends Collisor{
   onCollision(){
      for (let i in this.collision){
         if (this.collision[i].tag === 'enemy'){
            /* logic here */
         }
      }
  }
}

See also GameObj.update and Drawable.draw.