-
Notifications
You must be signed in to change notification settings - Fork 0
Projectile
nhmkdev edited this page Jan 4, 2014
·
3 revisions
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.
var Projectiles = ig.global.data.projectiles;
Projectiles support two animation states:
- active - Non-collided moving state
- splash - Upon collision with a wall
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
}
}
}
}