Skip to content
nhmkdev edited this page Jan 4, 2014 · 3 revisions

Definition

A Projectile is something that moves and collides with a player/enemy/collision. Upon collision a number of points is removed from the entity. This code is game specific and should be reworked to fit your game.

Container

var Projectiles = ig.global.data.projectiles;

Data Format

Projectiles support two animation states:

  • active - Non-collided moving state
  • splash - Upon collision with a wall

Format (TODO: need to verify and clarify defaults)

Projectiles.redLaser = 
{
    d:-10, // point damage
    vp:100, // x-position push on entity hit (default: 0)
    v: {x: 400, y: 400}, // velocity maximums
    a: // animation object
    {
	i:'laser', // image name ('media/' is prepended)
	w:8, // width of frame
	h:8, // height of frame
	s: { x: 8, y: 2}, // size
	o: { x: 0, y: 3}, // offset
	a:
	{ // animations
	    active:
	    {
		ft:'0.2', // frametime
		seq:[0,1] // sequence
	    },
	    splash:
	    {
		ft:'0.1', // frametime
		seq:[2,3,4,5,6], // sequence
		s:true
	    }
	}
    }    
}

Clone this wiki locally