User prompt
set bg color to 170615
User prompt
Also update LK.setScore when the score text is updated
User prompt
Decrease the initial Helth of enemies
User prompt
Make initial hero bullet speed twice as fast
User prompt
Hero misses should start with a bit of speed
User prompt
Increase red flashes to 1 secound
User prompt
Make shield flash red when hit by bullets
User prompt
Make hero flash red when hit by bullets
User prompt
Make enemies flash red when hit by bullets
User prompt
Remove calls to updateHitEffect
User prompt
Remove code that flashes hero and enemies red when hit by bullets
User prompt
Fix Bug: 'TypeError: null is not an object (evaluating 'this.context.font=this.style._font||this.style.font')' in this line: 'var scoreText = new Text2('0', {' Line Number: 213
User prompt
add a score multiplier type to the powerup class
User prompt
Add a powerup type that increments a score multiplier by 10% for each collection. Score multiplier should only be applied to future points collected
User prompt
Attach hero bullets at a z index below the hero ship
User prompt
Cap speed of enemy bullets such that enemy bullets are never fired faster than every 60 ticks
User prompt
Make the enemy bullet fire rate be influenced by wave round. Simply subtract wave counter * 5 from the 180
User prompt
Further decrease the rate of fire of enemies
User prompt
Decrease rate of enemy bullet fire
User prompt
There seems to be two checks for firing bullets in handleTick, remove the secound one
User prompt
Make each enemy have its own tick offset where it fires bullets
User prompt
Change the minimum firerate for spawning the powerup powerup from 5 to 20
User prompt
Change Enhanced Bullet Homing to Enhancing Bullet Homing
User prompt
change Bullets now home in on enemies to something similar to "increase bullet homing power" but make it sound better
User prompt
Set bullet curve text such that it better describes what happens when that powerup is picked up
===================================================================
--- original.js
+++ change.js
@@ -3,30 +3,30 @@
self.type = type;
var powerupGraphics;
switch (type) {
case 'extraBullet':
- powerupGraphics = XS.getAsset('extraBulletPowerup', 'Extra Bullet Powerup Graphics', 0.5, 0.5);
+ powerupGraphics = LK.getAsset('extraBulletPowerup', 'Extra Bullet Powerup Graphics', 0.5, 0.5);
break;
case 'shield':
- powerupGraphics = XS.getAsset('shieldPowerup', 'Shield Powerup Graphics', 0.5, 0.5);
+ powerupGraphics = LK.getAsset('shieldPowerup', 'Shield Powerup Graphics', 0.5, 0.5);
break;
case 'speed':
- powerupGraphics = XS.getAsset('speedPowerup', 'Speed Powerup Graphics', 0.5, 0.5);
+ powerupGraphics = LK.getAsset('speedPowerup', 'Speed Powerup Graphics', 0.5, 0.5);
break;
case 'health':
- powerupGraphics = XS.getAsset('healthPowerup', 'Health Powerup Graphics', 0.5, 0.5);
+ powerupGraphics = LK.getAsset('healthPowerup', 'Health Powerup Graphics', 0.5, 0.5);
break;
case 'missileSpeed':
- powerupGraphics = XS.getAsset('missileSpeedPowerup', 'Missile Speed Powerup Graphics', 0.5, 0.5);
+ powerupGraphics = LK.getAsset('missileSpeedPowerup', 'Missile Speed Powerup Graphics', 0.5, 0.5);
break;
case 'curveBullet':
- powerupGraphics = XS.getAsset('curveBulletPowerup', 'Curve Bullet Powerup Graphics', 0.5, 0.5);
+ powerupGraphics = LK.getAsset('curveBulletPowerup', 'Curve Bullet Powerup Graphics', 0.5, 0.5);
break;
case 'scoreMultiplier':
- powerupGraphics = XS.getAsset('scoreMultiplierPowerup', 'Score Multiplier Powerup Graphics', 0.5, 0.5);
+ powerupGraphics = LK.getAsset('scoreMultiplierPowerup', 'Score Multiplier Powerup Graphics', 0.5, 0.5);
break;
default:
- powerupGraphics = XS.getAsset('powerup', 'Powerup Graphics', 0.5, 0.5);
+ powerupGraphics = LK.getAsset('powerup', 'Powerup Graphics', 0.5, 0.5);
break;
}
self.addChild(powerupGraphics);
self.speed = 3;
@@ -35,9 +35,9 @@
};
});
var HealthBar = Container.expand(function (maxHealth, color) {
var self = Container.call(this);
- var barGraphics = XS.getAsset('healthBar', 'Health Bar Graphics', .5, 1);
+ var barGraphics = LK.getAsset('healthBar', 'Health Bar Graphics', .5, 1);
barGraphics.tint = color;
self.addChild(barGraphics);
self.maxHealth = maxHealth;
self.currentHealth = maxHealth;
@@ -48,11 +48,11 @@
self.intersectable = false;
});
var HeroBullet = Container.expand(function (acceleration, enemies, curveBullet) {
var self = Container.call(this);
- var bulletGraphics = XS.getAsset('heroBullet', 'Hero Bullet Graphics', 0.5, 0.5);
+ var bulletGraphics = LK.getAsset('heroBullet', 'Hero Bullet Graphics', 0.5, 0.5);
self.addChild(bulletGraphics);
- self.speed = 0;
+ self.speed = 5;
self.acceleration = 0.2;
self.curveBullet = curveBullet || 0;
self.move = function () {
self.speed += self.acceleration;
@@ -83,9 +83,9 @@
};
});
var EnemyBullet = Container.expand(function () {
var self = Container.call(this);
- var bulletGraphics = XS.getAsset('enemyBullet', 'Enemy Bullet Graphics', 0.5, 0.5);
+ var bulletGraphics = LK.getAsset('enemyBullet', 'Enemy Bullet Graphics', 0.5, 0.5);
bulletGraphics.rotation = Math.PI;
self.addChild(bulletGraphics);
self.speed = 5;
self.move = function () {
@@ -94,18 +94,18 @@
};
});
var Hero = Container.expand(function () {
var self = Container.call(this);
- var heroGraphics = XS.getAsset('hero', 'Hero Spaceship', 0.5, 0.5);
+ var heroGraphics = LK.getAsset('hero', 'Hero Spaceship', 0.5, 0.5);
self.addChild(heroGraphics);
self.health = 100;
self.healthBar = self.addChild(new HealthBar(100, 0x00ff00));
self.healthBar.y = -heroGraphics.height / 2 - 50;
self.healthBar.updateHealth(self.health);
self.shieldBar = self.addChild(new HealthBar(10, 0x4682B4));
self.shieldBar.y = self.healthBar.y - 30;
self.shieldBar.visible = false;
- self.shieldEffect = XS.getAsset('shieldEffect', 'Shield Effect Graphics', 0.5, 0.5);
+ self.shieldEffect = LK.getAsset('shieldEffect', 'Shield Effect Graphics', 0.5, 0.5);
self.shieldEffect.visible = false;
self.shieldEffect.alpha = 0.5;
self.addChildAt(self.shieldEffect, 1);
self.updateShield = function () {
@@ -130,9 +130,9 @@
self.scoreMultiplier = 1;
});
var Enemy = Container.expand(function (currentWave) {
var self = Container.call(this);
- var enemyGraphics = XS.getAsset('enemy', 'Enemy Spaceship', 0.5, 0.5);
+ var enemyGraphics = LK.getAsset('enemy', 'Enemy Spaceship', 0.5, 0.5);
self.addChild(enemyGraphics);
self.speed = 6;
self.health = 50 + currentWave * 10;
self.targetY = Math.random() * (2732 / 3) + enemyGraphics.height;
@@ -145,16 +145,16 @@
self.move = function () {
if (self.y < self.targetY) {
self.y += self.speed;
}
- self.x += Math.sin((XS.ticks + self.sidewaysOffset) / 30) * 5;
+ self.x += Math.sin((LK.ticks + self.sidewaysOffset) / 30) * 5;
if (self.x < 0) self.x = 0;
if (self.x > 2048 - enemyGraphics.width) self.x = 2048 - enemyGraphics.width;
};
});
var StarField = Container.expand(function () {
var self = Container.call(this);
- var starGraphics = XS.getAsset('star', 'Star Graphics', 0.5, 0.5);
+ var starGraphics = LK.getAsset('star', 'Star Graphics', 0.5, 0.5);
self.addChild(starGraphics);
self.speed = (Math.random() * 2 + 1) * 0.5;
self.alpha = self.speed / 2;
self.move = function () {
@@ -168,9 +168,9 @@
};
});
var Game = Container.expand(function () {
var self = Container.call(this);
- var background = XS.getAsset('background', 'Background Graphics', 0.5, 1);
+ var background = LK.getAsset('background', 'Background Graphics', 0.5, 1);
background.x = 2048 / 2;
background.y = 2732;
background.alpha = 0.4;
self.addChild(background);
@@ -198,16 +198,16 @@
fill: "#ffffff",
defaultFont: "'Arial', sans-serif"
});
scoreText.anchor.set(0.5, 0);
- XS.gui.topCenter.addChild(scoreText);
+ LK.gui.topCenter.addChild(scoreText);
var powerupLabel = new Text2('', {
size: 64,
font: "Verdana",
fill: "#ffffff"
});
powerupLabel.anchor.set(0.5, 0);
- XS.gui.topCenter.addChild(powerupLabel);
+ LK.gui.topCenter.addChild(powerupLabel);
powerupLabel.y = scoreText.height + 10;
powerupLabel.visible = false;
function spawnWave() {
for (var i = 0; i < 5; i++) {
@@ -242,9 +242,9 @@
waveText.anchor.set(0.5, 0.5);
waveText.x = 2048 / 2;
waveText.y = 2732 / 2;
self.addChild(waveText);
- XS.setTimeout(function () {
+ LK.setTimeout(function () {
waveText.destroy();
}, 2000);
}
function fireHeroBullet(enemies, curveBullet) {
@@ -308,9 +308,9 @@
heroBullet = null;
enemy.health -= 10;
enemy.healthBar.updateHealth(enemy.health);
enemy.hitEffectCounter = 10;
- XS.effects.flashObject(enemy, 0xff0000, 1000);
+ LK.effects.flashObject(enemy, 0xff0000, 1000);
if (enemy.health <= 0) {
enemy.destroy();
enemies.splice(eIndex, 1);
score += Math.floor(100 * hero.scoreMultiplier);
@@ -329,14 +329,14 @@
enemyBullets.splice(index, 1);
if (hero.shield > 0) {
hero.shield--;
hero.updateShield();
- XS.effects.flashObject(hero.shieldEffect, 0xff0000, 1000);
+ LK.effects.flashObject(hero.shieldEffect, 0xff0000, 1000);
} else {
hero.health -= 10;
hero.healthBar.updateHealth(hero.health);
hero.hitEffectCounter = 10;
- XS.effects.flashObject(hero, 0xff0000, 1000);
+ LK.effects.flashObject(hero, 0xff0000, 1000);
}
}
}
for (var index = powerups.length - 1; index >= 0; index--) {
@@ -382,9 +382,9 @@
powerupLabel.setText('Score Multiplier +10%');
break;
}
powerupLabel.visible = true;
- XS.setTimeout(function () {
+ LK.setTimeout(function () {
powerupLabel.visible = false;
}, 3000);
}
}
@@ -428,20 +428,20 @@
currentWave++;
spawnWave();
}
if (hero.health <= 0) {
- XS.showGameOver();
+ LK.showGameOver();
}
- if (XS.ticks % Math.floor(hero.fireRate) === 0) {
+ if (LK.ticks % Math.floor(hero.fireRate) === 0) {
fireHeroBullet(enemies, hero.curveBullet);
heroBullets.forEach(function (bullet) {
self.addChildAt(bullet, self.getChildIndex(hero));
});
}
enemies.forEach(function (enemy, index) {
- if ((XS.ticks + enemy.tickOffset) % Math.max(60, 180 - currentWave * 5) === 0) {
+ if ((LK.ticks + enemy.tickOffset) % Math.max(60, 180 - currentWave * 5) === 0) {
fireEnemyBullet(enemy);
}
});
}
- XS.on('tick', handleTick);
+ LK.on('tick', handleTick);
});
Round powerup. Shield icon Single Game Texture. In-Game asset. 2d. Pixelart. White background. Blank background. Low detail. High contrast.
Extra missile powerup circle. Missile and plus sign. Single Game Texture. In-Game asset. 2d. Pixelart. White background. Blank background. Low detail. High contrast.
Single space torpedo flying upwards Game Texture. In-Game asset. 2d. Pixelart. White background. Blank background. Low detail. High contrast.
Background galaxy nebulas and galaxies Single Game Texture. In-Game asset. 2d. Pixelart. White background. Blank background. Low detail. High contrast. --ar 1:10
Round powerup. Green health icon Single Game Texture. In-Game asset. 2d. Pixelart. White background. Blank background. Low detail. High contrast.
Blue glowing powerup circle with s in center Single Game Texture. In-Game asset. 2d. Pixelart. White background. Blank background. Low detail. High contrast.
Round powerup. Lightning icon pointing up. Single Game Texture. In-Game asset. 2d. Pixelart. White background. Blank background. Low detail. High contrast.
Stylish hero spaceship facing upwards, with a single cannon in the center. Single Game Texture. In-Game asset. 2d. Pixelart. White background. Blank background. Low detail. High contrast.
single alien enemy spaceship facing down, looking like space alien adopted to living in space. Game Texture. In-Game asset. 2d. Pixelart. White background. Blank background. Low detail. High contrast.
Single enemy slime bullet, seen from above facing upwards. Single Game Texture. In-Game asset. 2d. Pixelart. White background. Blank background. Low detail. High contrast.
Round powerup icon with bullseye Single Game Texture. In-Game asset. 2d. Pixelart. White background. Blank background. Low detail. High contrast.
Clean plasma bubble Single Game Texture. In-Game asset. 2d. Pixelart. White background. Blank background. Low detail. High contrast.