1 decade ago by coreysnyder
Here is an entity that I have:
Now I have a set of menus that sit over the game. One of these menus is a store. I want to be able to upgrade the damage of the snowball if it is purchased from inside the store. From then on, any time that entity is spawned it has the updated damage. Has anyone accomplished this before? If so, how?
Thanks,
Corey
EntitySnowball = EntityWeapon.extend({ animSheet: new ig.AnimationSheet( 'media/web/ammo/snowball.png', 18, 18), weaponID: 0, size: {x: 18, y: 18}, bounciness: 0.6, friction: {x:500, y: 0}, damage: 1, init: function (x, y, settings) { this.velocity = settings.velocity || {x: 0, y: 0}; this.parent(x, y, settings); this.addAnim( 'idle', 1, [0]); this.pos = {x: x, y: y}; } });
Now I have a set of menus that sit over the game. One of these menus is a store. I want to be able to upgrade the damage of the snowball if it is purchased from inside the store. From then on, any time that entity is spawned it has the updated damage. Has anyone accomplished this before? If so, how?
Thanks,
Corey