Tracer weapon

This commit is contained in:
zenoamaro committed 2019-06-30 04:39:43 +02:00
1 parent 10ebf45a0f
commit 141437836e
2 files changed
+12

No files matched your search

+1
View File
@@ -55,6 +55,7 @@ for (let [color, borderColor] of PLAYER_COLORS) {
{type: 'smallDigBomb', ammo:5},
{type: 'digBomb', ammo:3},
{type: 'largeDigBomb', ammo:1},
{type: 'tracer', ammo:Infinity},
],
currentWeapon: 0,
energy: PLAYER_MAX_ENERGY,
+11
View File
@@ -13,6 +13,7 @@ export function drawDirt(ctx, x, y, r, c) {
}
export const WEAPON_TYPES = [
{id:'tracer', name:'Tracer', explosion:{type:'tracer'}},
{id:'babyMissile', name:'Baby Missile', explosion:{type:'blast', r:5}},
{id:'missile', name:'Missile', explosion:{type:'blast', r:20}},
{id:'babyNuke', name:'Baby Nuke', explosion:{type:'blast', r:50}},
@@ -41,6 +42,16 @@ export const DEATH_SPECS = [
];
export const EXPLOSION_TYPES = {
tracer: {
create(spec, x, y) {
return {type:'tracer'};
},
update(explosion) {},
draw(explosion, foreground) {},
stop(explosion) {},
clip(explosion, terrain) {},
damage(explosion, player) {}
},
blast: {
create(spec, x, y) {
const {r} = spec;