User prompt
Each exp orb should give a fixed 1 EXP. It doesn't seem to be the case right now. We need to fix that.
User prompt
You need to change the leveling system. In order to move to the next level, I need to have the same amount of exp orbs as my current level. (So if I started at level 1, I need 1 exp orb to move to level 2, 2 exp orbs to move to level 3, 3 exp orbs to move to level 4.)
User prompt
"Death" sound when killing an enemy. I want to play a "hit" sound when hitting an enemy. Right now, the hit sound plays when an enemy dies, but the hit sound should play when I hit the enemy, not when the enemy dies. The death sound should play when the enemy dies.
User prompt
Do it for me.
Code edit (2 edits merged)
Please save this source code
User prompt
I want to use the image named "seamlessBackGround" in the background.
Code edit (6 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: e.takeDamage is not a function' in or related to this line: 'if (e.takeDamage(dmg)) {' Line Number: 594
Code edit (8 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: Graphics is not a constructor' in or related to this line: 'var gfx = new Graphics();' Line Number: 778
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'cdCnt')' in or related to this line: 'if (--inst.cdCnt <= 0) {' Line Number: 302
Code edit (5 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'cdCnt')' in or related to this line: 'if (--inst.cdCnt <= 0) {' Line Number: 304
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'update')' in or related to this line: 'BrickProj.parent.update.call(b);' Line Number: 680
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'update')' in or related to this line: 'BrickProj.parent.update.call(p);' Line Number: 754
User prompt
Please fix the bug: 'ReferenceError: fireWeapon is not defined' in or related to this line: 'fireWeapon(key, inst, meta);' Line Number: 223
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: meta is not defined' in or related to this line: 'if (e.intersectsCircle(arc.x, arc.y, meta.range * inst.rngMul) && e.takeDamage(arc.dmg)) {' Line Number: 383
User prompt
Please fix the bug: 'spawnWave is not defined' in or related to this line: 'spawnWave();' Line Number: 1076
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: dropExpOrb is not defined' in or related to this line: 'dropExpOrb(en.x, en.y, en.expValue);' Line Number: 593
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); var storage = LK.import("@upit/storage.v1"); /**** * Classes ****/ /******************************************************************** * ENEMY CLASSES (unchanged temel) * ********************************************************************/ var Enemy = Container.expand(function () { var self = Container.call(this); var s = Container.call(this); s.hp = 20; s.damage = 10; s.speed = 2; s.expValue = 5; s.type = 'normal'; s.attachAsset('zombie', { anchorX: 0.5, anchorY: 0.5 }); s.takeDamage = function (a) { s.hp -= a; LK.effects.flashObject(s, 0xffffff, 60); return s.hp <= 0; }; s.update = function () { if (!player || skillSelect) return; var v = dirTo(s, player); s.x += v.dx * s.speed; s.y += v.dy * s.speed; }; return s; }); var TankZombie = Enemy.expand(function () { var self = Enemy.call(this); var z = Enemy.call(this); z.hp = 60; z.damage = 20; z.speed = 1; z.attachAsset('tankZombie', { anchorX: 0.5, anchorY: 0.5 }); return z; }); var FastZombie = Enemy.expand(function () { var self = Enemy.call(this); var z = Enemy.call(this); z.hp = 15; z.damage = 8; z.speed = 4; z.attachAsset('fastZombie', { anchorX: 0.5, anchorY: 0.5 }); return z; }); var Boss = Enemy.expand(function () { var self = Enemy.call(this); var z = Enemy.call(this); z.hp = 500; z.damage = 30; z.speed = 1.5; z.type = 'boss'; z.attachAsset('boss', { anchorX: 0.5, anchorY: 0.5 }); return z; }); /******************************************************************** * EXP ORB & PICKUPS * ********************************************************************/ var ExpOrb = Container.expand(function () { var self = Container.call(this); var o = Container.call(this); o.value = 5; o.magnet = 0; o.attachAsset('expOrb', { anchorX: 0.5, anchorY: 0.5 }); o.update = function () { if (o.magnet) { var v = dirTo(o, player); o.x += v.dx * o.magnet; o.y += v.dy * o.magnet; } }; return o; }); /* Bomb ve Magnet sınıfların eski hâli korunuyor — kod kısaltmak için buraya tekrar yazılmadı. */ /******************************************************************** * JOYSTICK (değişmedi) * ********************************************************************/ var Joystick = Container.expand(function () { var self = Container.call(this); var j = Container.call(this); j.active = false; j.dirX = 0; j.dirY = 0; var base = j.attachAsset('joystickBase', { anchorX: 0.5, anchorY: 0.5 }); var knob = j.attachAsset('joystickKnob', { anchorX: 0.5, anchorY: 0.5 }); j.setPos = function (x, y) { var dx = x - base.x, dy = y - base.y, d = Math.sqrt(dx * dx + dy * dy), m = 60; if (d > m) { dx = dx / d * m; dy = dy / d * m; } knob.x = dx; knob.y = dy; j.dirX = dx / m; j.dirY = dy / m; }; j.reset = function () { knob.x = knob.y = j.dirX = j.dirY = 0; j.active = false; }; return j; }); /******************************************************************** * PLAYER * ********************************************************************/ var Player = Container.expand(function () { var self = Container.call(this); var p = Container.call(this); p.level = 1; p.exp = 0; p.expNext = 10; p.hp = 100; p.hpMax = 100; p.moveSpeed = 5; p.pickRange = 120; p.attachAsset('player', { anchorX: 0.5, anchorY: 0.5 }); /*--------- Silah envanteri ---------*/ p.weapons = {}; addWeapon('sword'); function addWeapon(k) { if (p.weapons[k]) return; var m = WEAPONS[k]; p.weapons[k] = { cd: m.cd, cdCnt: 0, dmg: 1, range: 1, size: 1, amount: 1, upg: 0, ench: [] }; } /*--------- EXP / Level ---------*/ p.gain = function (v) { p.exp += v; if (p.exp >= p.expNext) levelUp(); }; function levelUp() { p.level++; p.exp = 0; p.expNext = p.level * 15; p.hpMax += 10; p.hp = Math.min(p.hpMax, p.hp + p.hpMax * 0.3); LK.getSound('levelup').play(); openChoice(); } /*--------- Güncelle ---------*/ p.update = function () { for (var key in p.weapons) { var inst = p.weapons[key], meta = WEAPONS[key]; if (--inst.cdCnt <= 0) { fireWeapon(key, inst, meta); inst.cdCnt = inst.cd; } } }; return p; /*===================== LEVEL-UP SEÇİM ==========================*/ function openChoice() { skillSelect = true; var ov = game.addChild(new Container()); ov.x = 1024; ov.y = 1366; var ch = []; if (p.level % 5 === 0) { var pool = Object.keys(WEAPONS); for (var i = 0; i < 3; i++) { ch.push(pool.splice(Math.random() * pool.length | 0, 1)[0]); } } else { var cur = Object.keys(p.weapons)[0], inst = p.weapons[cur], meta = WEAPONS[cur]; var pool = meta.ench.filter(function (e) { return inst.ench.indexOf(e) === -1; }); if (pool.length === 0) { skillSelect = false; ov.destroy(); return; } for (var i = 0; i < 3 && pool.length; i++) ch.push({ w: cur, e: pool.splice(Math.random() * pool.length | 0, 1)[0] }); } ch.forEach(function (c, i) { var card = ov.addChild(new Container()); card.attachAsset('skillCard', { anchorX: 0.5, anchorY: 0.5 }); card.x = (i - 1) * 450; card.y = 0; var label; card["do"] = function () {}; if (typeof c === 'string') { // weapon kartı var own = !!p.weapons[c]; if (!own) { label = "Unlock " + c; card["do"] = function () { return addWeapon(c); }; } else if (p.weapons[c].upg < 3) { label = UPG_LABELS[c][p.weapons[c].upg]; card["do"] = function () { p.weapons[c].upg++; p.weapons[c].amount++; }; } else { label = "Heal 30%"; card["do"] = function () { p.hp = Math.min(p.hpMax, p.hp + p.hpMax * 0.3); }; } } else { // enchant kartı label = c.e; card["do"] = function () { var inst = p.weapons[c.w]; inst.ench.push(c.e); if (c.e === ENCH_LABELS[0]) inst.dmg *= 1.1; if (c.e === ENCH_LABELS[1]) inst.cd *= 0.9; if (c.e === ENCH_LABELS[2]) inst.range *= 1.1; if (c.e === ENCH_LABELS[3]) inst.size *= 1.1; }; } var t = new Text2(label, { size: 38, fill: 0xffffff }); t.anchor.set(0.5); card.addChild(t); card.down = function () { this["do"](); ov.destroy(); skillSelect = false; levelTxt.setText("Level " + p.level); }; }); } /*=================================================================*/ }); /**** * Initialize Game ****/ /******************************************************************** * FIRE WEAPON HELPERS (compact) * ********************************************************************/ /******************************************************************** * GAME INITIALISATION * ********************************************************************/ var game = new LK.Game({ backgroundColor: 0x111111 }); /**** * Game Code ****/ /******************************************************************** * GLOBAL HELPERS & DATA * ********************************************************************/ /**** PLUG-INS ****************************************************/ /**** ASSETS ******************************************************/ /******************************************************************** * SURVIVOR-LIKE (Full integrated file — nine weapons, enchants) * ********************************************************************/ function rand(min, max) { return min + Math.random() * (max - min); } function dist2(a, b) { var dx = a.x - b.x, dy = a.y - b.y; return dx * dx + dy * dy; } function dirTo(s, t) { var dx = t.x - s.x, dy = t.y - s.y, d = Math.sqrt(dx * dx + dy * dy); return { dx: dx / d, dy: dy / d }; } var WEAPONS = { sword: { cd: 120, dmg: 10, range: 90, type: 'melee', ench: [0, 1, 2, 3], upg: [0, 1, 2] }, boomerang: { cd: 180, dmg: 10, range: 900, type: 'boomerang', ench: [0, 1, 2, 3], upg: [0, 1, 2] }, ball: { cd: 180, dmg: 12, range: 900, type: 'ball', ench: [0, 1, 2, 3], upg: [0, 1, 2] }, rocket: { cd: 180, dmg: 20, range: 650, type: 'rocket', ench: [0, 1, 2, 3], upg: [0, 1, 2] }, brick: { cd: 180, dmg: 15, range: 800, type: 'brick', ench: [0, 1, 2, 3], upg: [0, 1, 2] }, lightning: { cd: 180, dmg: 25, range: 9999, type: 'lightning', ench: [0, 1, 2, 3], upg: [0, 1, 2] }, aura: { cd: 60, dmg: 5, range: 150, type: 'aura', ench: [0, 1, 2, 3], upg: [0, 1, 2] }, molotov: { cd: 180, dmg: 12, range: 850, type: 'molotov', ench: [0, 1, 2, 3], upg: [0, 1, 2] }, shuriken: { cd: 180, dmg: 8, range: 250, type: 'shuriken', ench: [0, 1, 2, 3], upg: [0, 1, 2] } }; var ENCH_LABELS = ["+10% Damage", "+10% FireRate", "+10% Range", "+10% Size"]; var UPG_LABELS = { sword: ["Back Swing", "Up Swing", "Down Swing"], boomerang: ["Boomerang +1", "Boomerang +1", "Boomerang +1"], ball: ["Ball +1", "Ball +1", "Ball +1"], rocket: ["Rocket +1", "Rocket +1", "Rocket +1"], brick: ["Back 75°", "Front 45°", "Back 45°"], lightning: ["Lightning +1", "Lightning +1", "Lightning +1"], aura: ["Slow 25%", "Slow 50%", "Slow 75%"], molotov: ["Molotov +1", "Molotov +1", "Molotov +1"], shuriken: ["Shuriken +1", "Shuriken +1", "Shuriken +1"] }; /******************************************************************** * GENERIC PROJECTILE FACTORY * ********************************************************************/ function makeProjectile(shapeKey) { return Container.expand(function () { var self = Container.call(this); self.dirX = 0; self.dirY = 0; self.speed = 12; self.dmg = 10; self.life = 300; self.attachAsset(shapeKey, { anchorX: 0.5, anchorY: 0.5 }); self.update = function () { self.x += self.dirX * self.speed; self.y += self.dirY * self.speed; if (--self.life <= 0) { self.destroy(); } }; return self; }); } var BoomProj = makeProjectile('boomerang'); var BallProj = makeProjectile('ball'); var RocketProj = makeProjectile('rocket'); var BrickProj = makeProjectile('brick'); var ShuriProj = makeProjectile('shuriken'); /******************************************************************** * FIRE WEAPON HELPERS (compact) * ********************************************************************/ /* Main fireWeapon dispatcher */ function fireWeapon(key, inst, meta) { switch (key) { case 'sword': swingSword(inst); break; case 'boomerang': throwBoomerang(inst); break; case 'ball': throwBall(inst); break; case 'rocket': fireRocket(inst); break; case 'brick': // Brick weapon throws multiple bricks at different angles if upgraded var baseAngles = [180]; if (inst.upg > 0) baseAngles.push(255); if (inst.upg > 1) baseAngles.push(135); if (inst.upg > 2) baseAngles.push(225); for (var i = 0; i < inst.amount; i++) { for (var j = 0; j < baseAngles.length; j++) { throwBrick(inst, baseAngles[j]); } } break; case 'lightning': for (var i = 0; i < inst.amount; i++) { strikeLightning(inst); } break; case 'aura': ensureAura(inst); break; case 'molotov': for (var i = 0; i < inst.amount; i++) { throwMolotov(inst); } break; case 'shuriken': ensureShurikenRing(inst); break; } } function nearest() { var n = null, d = 1e9; for (var i = 0; i < enemies.length; i++) { var e = enemies[i], q = dist2(e, player); if (q < d) { d = q; n = e; } } return n; } function damageEnemy(e, amount) { if (e.takeDamage(amount)) { dropExpOrb(e.x, e.y, e.expValue); e.destroy(); enemies.splice(enemies.indexOf(e), 1); } } /* melee sword */ function swingSword(inst) { var arc = new Container(); arc.x = player.x; arc.y = player.y; arc.attachAsset('swordHit', { anchorX: 0, anchorY: 0.5, rotation: player.rotation, scaleX: inst.size, scaleY: inst.size }); arc.life = 10; arc.dmg = 10 * inst.dmg; arc.update = function () { if (--arc.life <= 0) { arc.destroy(); return; } for (var i = enemies.length - 1; i >= 0; i--) { if (dist2(enemies[i], arc) < Math.pow(WEAPONS.sword.range * inst.range, 2)) { damageEnemy(enemies[i], arc.dmg); } } }; gameContainer.addChild(arc); } /* ranged helpers (boomerang, ball, rocket, brick) */ function launchSimple(Cls, inst, setup) { var e = nearest(); if (!e) return; var v = dirTo(player, e); for (var i = 0; i < inst.amount; i++) { var p = new Cls(); p.x = player.x; p.y = player.y; setup(p, v, i); bullets.push(p); gameContainer.addChild(p); } } function throwBoomerang(inst) { launchSimple(BoomProj, inst, function (p, v, i) { p.dirX = v.dx; p.dirY = v.dy; p.dmg = 10 * inst.dmg; p["return"] = false; p.update = function () { if (!p["return"] && --p.life < 180) { p["return"] = true; } if (p["return"]) { var v = dirTo(p, player); p.dirX = v.dx; p.dirY = v.dy; } BoomProj.parent.update.call(p); for (var k = enemies.length - 1; k >= 0; k--) if (p.intersects(enemies[k])) damageEnemy(enemies[k], p.dmg); }; }); } function throwBall(inst) { launchSimple(BallProj, inst, function (p, v) { p.dirX = v.dx; p.dirY = v.dy; p.dmg = 12 * inst.dmg; }); } function fireRocket(inst) { launchSimple(RocketProj, inst, function (p, v) { p.dirX = v.dx; p.dirY = v.dy; p.dmg = 20 * inst.dmg; p.update = function () { RocketProj.parent.update.call(p); for (var k = enemies.length - 1; k >= 0; k--) if (p.intersects(enemies[k])) { LK.getSound('rocketBoom').play(); for (var m = enemies.length - 1; m >= 0; m--) if (dist2(enemies[m], p) < 16000) damageEnemy(enemies[m], p.dmg); p.destroy(); bullets.splice(bullets.indexOf(p), 1); break; } }; }); } function throwBrick(inst, ang) { var rad = ang * Math.PI / 180; var v = { dx: Math.cos(rad), dy: Math.sin(rad) }; var p = new BrickProj(); p.x = player.x; p.y = player.y; p.dirX = v.dx; p.dirY = v.dy; p.speed = 14; p.g = 0.3; p.dmg = 15 * inst.dmg; p.update = function () { p.y += p.g; BrickProj.parent.update.call(p); if (Math.abs(p.x - player.x) > 1200 || Math.abs(p.y - player.y) > 1600) { p.destroy(); bullets.splice(bullets.indexOf(p), 1); } else for (var k = enemies.length - 1; k >= 0; k--) if (p.intersects(enemies[k])) damageEnemy(enemies[k], p.dmg); }; bullets.push(p); gameContainer.addChild(p); } function strikeLightning(inst) { var e = enemies[Math.random() * enemies.length | 0]; if (!e) return; var l = new Container(); l.attachAsset('lightning', { anchorX: 0.5, anchorY: 1 }); l.x = e.x; l.y = e.y; l.life = 20; l.update = function () { if (--l.life === 19) damageEnemy(e, 25 * inst.dmg); if (l.life <= 0) { l.destroy(); } }; gameContainer.addChild(l); } var auraField = null; function ensureAura(inst) { if (auraField) { auraField.x = player.x; auraField.y = player.y; return; } auraField = new Container(); auraField.attachAsset('auraField', { anchorX: 0.5, anchorY: 0.5, alpha: 0.35 }); auraField.update = function () { auraField.x = player.x; auraField.y = player.y; for (var i = enemies.length - 1; i >= 0; i--) { if (dist2(enemies[i], auraField) < Math.pow(WEAPONS.aura.range * inst.range, 2)) { if (inst.upg > 0) enemies[i].speed = WEAPONS.zombie ? enemies[i].speed : enemies[i].speed * 0.75; damageEnemy(enemies[i], inst.dmg); } } }; gameContainer.addChild(auraField); } function throwMolotov(inst) { var a = Math.random() * Math.PI * 2, d = rand(300, 600), tx = player.x + Math.cos(a) * d, ty = player.y + Math.sin(a) * d; var p = new BrickProj(); p.x = player.x; p.y = player.y; var v = dirTo(p, { x: tx, y: ty }); p.dirX = v.dx; p.dirY = v.dy; p.speed = 16; p.dmg = 0; p.life = 90; p.update = function () { BrickProj.parent.update.call(p); if (p.life < 60) { spawnFlame(tx, ty, inst); p.destroy(); } }; bullets.push(p); gameContainer.addChild(p); } function spawnFlame(x, y, inst) { var f = new Container(); f.attachAsset('molotovFlame', { anchorX: 0.5, anchorY: 0.5, alpha: 0.4 }); f.x = x; f.y = y; f.life = 60; f.update = function () { if (--f.life <= 0) { f.destroy(); return; } for (var i = enemies.length - 1; i >= 0; i--) if (dist2(enemies[i], f) < 4900) damageEnemy(enemies[i], inst.dmg); }; gameContainer.addChild(f); } var shurikenRing = []; function ensureShurikenRing(inst) { if (shurikenRing.length !== inst.amount) { shurikenRing.forEach(function (s) { return s.destroy(); }); shurikenRing = []; var n = inst.amount; for (var i = 0; i < n; i++) { var s = new ShuriProj(); s.speed = 0; s.anchorR = i / n * Math.PI * 2; s.update = function () { this.anchorR += 0.15; this.x = player.x + Math.cos(this.anchorR) * WEAPONS.shuriken.range; this.y = player.y + Math.sin(this.anchorR) * WEAPONS.shuriken.range; for (var k = enemies.length - 1; k >= 0; k--) if (this.intersects(enemies[k])) damageEnemy(enemies[k], inst.dmg); }; shurikenRing.push(s); gameContainer.addChild(s); } } } var player, enemies = [], bullets = [], expOrbs = [], joystick, skillSelect = false; var gameContainer = game.addChild(new Container()); player = gameContainer.addChild(new Player()); player.x = 1024; player.y = 1366; joystick = new Joystick(); joystick.x = 0; joystick.y = -200; LK.gui.bottom.addChild(joystick); /* UI */ var levelTxt = new Text2("Level 1", { size: 60, fill: 0xffff00 }); levelTxt.anchor.set(0, 0); LK.gui.top.addChild(levelTxt); var hpTxt = new Text2("HP", { size: 60, fill: 0xff0000 }); hpTxt.anchor.set(1, 0); hpTxt.y = 100; LK.gui.top.addChild(hpTxt); var timerTxt = new Text2("15:00", { size: 80, fill: 0xffffff }); timerTxt.anchor.set(0.5, 0); LK.gui.top.addChild(timerTxt); /* Waves / spawn */ function spawnEnemy(t, x, y) { var e; switch (t) { case 'fast': e = new FastZombie(); break; case 'tank': e = new TankZombie(); break; case 'boss': e = new Boss(); break; default: e = new Enemy(); } e.x = x; e.y = y; enemies.push(e); gameContainer.addChild(e); } var waveN = 1, gameT = 0; function spawnWave() { var cnt = 5 + waveN * 2, rad = 1500; for (var i = 0; i < cnt && enemies.length < 30; i++) { var a = Math.random() * Math.PI * 2, x = player.x + Math.cos(a) * rad, y = player.y + Math.sin(a) * rad; var t = 'normal'; if (waveN > 5 && Math.random() < 0.3) t = 'fast'; if (waveN > 10 && Math.random() < 0.2) t = 'tank'; spawnEnemy(t, x, y); } } spawnWave(); /* EXP orb helper */ function dropExpOrb(x, y, val) { var o = new ExpOrb(); o.x = x; o.y = y; o.value = val; expOrbs.push(o); gameContainer.addChild(o); } /* INPUT */ game.down = function (x, y) { if (skillSelect) return; var l = game.toLocal({ x: x, y: y }); if (l.y > 2000) { joystick.active = true; joystick.setPos(0, 0); } }; game.move = function (x, y) { if (!joystick.active || skillSelect) return; var l = LK.gui.bottom.toLocal({ x: x, y: y }); joystick.setPos(l.x - joystick.x, l.y - joystick.y); }; game.up = function () { joystick.reset(); }; /* MAIN UPDATE */ game.update = function () { if (skillSelect) return; gameT++; /* Timer */ var left = 900 - (gameT / 60 | 0); if (left <= 0) { LK.showYouWin(); return; } timerTxt.setText((left / 60 | 0) + ':' + (left % 60 < 10 ? '0' : '') + left % 60); /* Player movement */ if (joystick.active) { player.x += joystick.dirX * player.moveSpeed; player.y += joystick.dirY * player.moveSpeed; } /* Camera */ gameContainer.x = -(player.x - 1024); gameContainer.y = -(player.y - 1366); /* Waves */ if (gameT % 300 === 0) { waveN++; spawnWave(); } if (gameT % 10800 === 0 && enemies.length < 30) spawnEnemy('boss', player.x + 400, player.y); /* Update arrays */ player.update(); bullets.forEach(function (b) { return b.update && b.update(); }); enemies.forEach(function (e) { return e.update && e.update(); }); expOrbs.forEach(function (o) { return o.update && o.update(); }); /* Bullet-enemy collision / off-screen cleanup handled inside bullet helpers */ /* Exp absorb */ for (var i = expOrbs.length - 1; i >= 0; i--) { var o = expOrbs[i]; if (dist2(o, player) < player.pickRange * player.pickRange) o.magnet = 10; if (o.intersects && o.intersects(player)) { player.gain(o.value); o.destroy(); expOrbs.splice(i, 1); LK.getSound('pickup').play(); } } /* UI refresh */ hpTxt.setText('HP: ' + player.hp + '/' + player.hpMax); levelTxt.setText('Level ' + player.level); };
===================================================================
--- original.js
+++ change.js
@@ -438,8 +438,53 @@
var ShuriProj = makeProjectile('shuriken');
/********************************************************************
* FIRE WEAPON HELPERS (compact) *
********************************************************************/
+/* Main fireWeapon dispatcher */
+function fireWeapon(key, inst, meta) {
+ switch (key) {
+ case 'sword':
+ swingSword(inst);
+ break;
+ case 'boomerang':
+ throwBoomerang(inst);
+ break;
+ case 'ball':
+ throwBall(inst);
+ break;
+ case 'rocket':
+ fireRocket(inst);
+ break;
+ case 'brick':
+ // Brick weapon throws multiple bricks at different angles if upgraded
+ var baseAngles = [180];
+ if (inst.upg > 0) baseAngles.push(255);
+ if (inst.upg > 1) baseAngles.push(135);
+ if (inst.upg > 2) baseAngles.push(225);
+ for (var i = 0; i < inst.amount; i++) {
+ for (var j = 0; j < baseAngles.length; j++) {
+ throwBrick(inst, baseAngles[j]);
+ }
+ }
+ break;
+ case 'lightning':
+ for (var i = 0; i < inst.amount; i++) {
+ strikeLightning(inst);
+ }
+ break;
+ case 'aura':
+ ensureAura(inst);
+ break;
+ case 'molotov':
+ for (var i = 0; i < inst.amount; i++) {
+ throwMolotov(inst);
+ }
+ break;
+ case 'shuriken':
+ ensureShurikenRing(inst);
+ break;
+ }
+}
function nearest() {
var n = null,
d = 1e9;
for (var i = 0; i < enemies.length; i++) {
Survivor.io style 2D sword swing effect made by HABBY PTE. LTD.. In-Game asset. 2d. High contrast. No shadows. It should only have a slash effect, no swords. The slash effect should also be in the shape of a half moon.
Survivor.io style 2D round soccer ball made by HABBY PTE. LTD.. In-Game asset. 2d. High contrast. No shadows
A 2D Survivor.io style lightning strike from a cloud in the sky to the ground, made by HABBY PTE. LTD.. In-Game asset. 2d. High contrast. No shadows
A red and blue Survivor.io style 2D U-shaped (with N and S) magnet made by HABBY PTE. LTD.. In-Game asset. 2d. High contrast. No shadows
Survivor.io style 2D shuriken made by HABBY PTE. LTD.. In-Game asset. 2d. High contrast. No shadows
Survivor.io style 2D brick made by HABBY PTE. LTD.. In-Game asset. 2d. High contrast. No shadows
Survivor.io style 2D missile rocket made by HABBY PTE. LTD.
A 2D green radiating circular aura in the Survivor.io style made by HABBY PTE. LTD.. In-Game asset. 2d. High contrast. No shadows
A 2D bomb in the style of Survivor.io, made by HABBY PTE. LTD.. In-Game asset. 2d. High contrast. No shadows
A 2D circular burning effect in Survivor.io style made by HABBY PTE. LTD. (not only the surroundings but also the inside burns) In-Game asset. 2d. High contrast. No shadows
A 2D molotov in the Survivor.io style made by HABBY PTE. LTD.. In-Game asset. 2d. High contrast. No shadows
Survivor.io style 2D greenish exp sphere made by HABBY PTE. LTD. No exp written on it. In-Game asset. 2d. High contrast. No shadows
Survivor.io style 2D half-moon orange boomerang made by HABBY PTE. LTD. In-Game asset. 2d. High contrast. No shadows
Survivor.io style 2D 1 chicken leg.. In-Game asset. 2d. High contrast. No shadows
2D survivor.io game style atomic boom effect front view. No text written on it.
2D. Ranged zombie. attacks with poisonous saliva. In-Game asset. 2d. High contrast. No shadows
2D. Child (small) zombie. He has a small saw in his hand.. In-Game asset. 2d. High contrast. No shadows
2D. Fat zombie. His hands are too big.. In-Game asset. 2d. High contrast. No shadows
Poisonous green circular saliva. 2D. Top View.. In-Game asset. 2d. High contrast. No shadows
Small green claw slash effect. 2D. Top View.. In-Game asset. 2d. High contrast. No shadows
Giant boss angry reddish zombie. 2D.. In-Game asset. 2d. High contrast. No shadows
Small saw slash effect. 2D. Top View.. In-Game asset. 2d. High contrast. No shadows
Big red fist slash effect. 2D. Top View.. In-Game asset. 2d. High contrast. No shadows
Kanlı kemik 2D. Top View.. In-Game asset. 2d. High contrast. No shadows
2D character that looks like a prophet and holds a holy book in his hand.. In-Game asset. 2d. High contrast. No shadows
A background image (wallpaper) representing an old prophet-like man with white hair and beard, wearing a priest's robe (hooded) and holding a holy book (christianity, cross) in his hand, fighting against zombies.. In-Game asset. 2d. High contrast. No shadows
Zombie flesh and bone themed 2D cardboard hollow (without text) horizontal rectangular button.. In-Game asset. 2d. High contrast. No shadows
2D. Healer zombie. Like a female zombie in a healer costume.. In-Game asset. 2d. High contrast. No shadows
2D. Brain illustrated healing potion.. In-Game asset. 2d. High contrast. No shadows
A healing blood pool with circular zombie brain and bone particles. Green + (healing) symbols on top. 2D.. In-Game asset. 2d. High contrast. No shadows
2D. Survivor.io game style skill card. No text written on it. No symbols on it. Just the blank card. Green.. In-Game asset. 2d. High contrast. No shadows
2D. Cartoon. The rise of the zombie ghost spirit from the ground.. In-Game asset. 2d. High contrast. No shadows
levelup
Sound effect
hit
Sound effect
rocketBoom
Sound effect
pickup
Sound effect
backGroundMusic
Music
death
Sound effect
damageTaken
Sound effect
mainMenuMusic
Music
deathScreenMusic
Music
swordSoundEffect
Sound effect
bumerangSoundEffect
Sound effect
brickSoundEffect
Sound effect
lightningSoundEffect
Sound effect
ballSoundEffect
Sound effect
rocketSoundEffect
Sound effect
auraSoundEffect
Sound effect
molotovSoundEffect
Sound effect
molotovBoom
Sound effect
introSpeech
Sound effect
bombBoomSound
Sound effect