User prompt
On mouse down set a canMove variable to true, on mouse up set the canMove variable to false
User prompt
Fix Bug: 'TypeError: hero.enemies[i] is undefined' in this line: 'pickup.x = hero.enemies[i].x;' Line Number: 132
User prompt
Move the healingpickup collection for loop outside of the enemies for loop
User prompt
enemies have a 10% chance of dropping a healing pickup that restores 10 health to the hero on touch; destroying the pickup
User prompt
Reduce enemy bobbing magnitude from 5 to 2
User prompt
enemies have a 10% chance of dropping a healing powerup that restores 10 health to the hero. Hero health cannot exceed 100
User prompt
Reduce enemy bobbing from magnitude 5 to magnitude 1
User prompt
Reduce enemy bobbing from sin(ticks / 10) * 5 to sin(ticks / 100) * 0.1
User prompt
decrease enemy bobbing from ticks / 10 to ticks / 100
User prompt
enemies bob up and down slightly when they walk
User prompt
increment score by 1 when an enemy is destroyed
User prompt
tile the background with grass
User prompt
Display a score at the top of the screen
User prompt
Change healthBarBorder.y to -115
User prompt
change healthBarBorder.y to -125
User prompt
change healthBar.y to -120
User prompt
hero has 1000 health
User prompt
enemies only move towards the player if they are more than 50 units away
User prompt
center the healthbar and border above the hero
User prompt
first create the healthBarBorder then the healthBar for the hero
User prompt
add a background border to the healthbar
User prompt
display a healthbar above the hero
User prompt
the hero has 100 health, while in contact with an enemy it loses 1 health per tick
User prompt
also update targetPos while the mouse is down
User prompt
hero bullets are destroyed and removed from their array when they go out of bounds
===================================================================
--- original.js
+++ change.js
@@ -59,8 +59,9 @@
grass.width = 2048;
grass.height = 2732;
self.addChild(grass);
var hero = self.addChild(new Hero());
+ var canMove = false;
var score = 0;
var scoreTxt = new Text2('Score: ' + score, {
size: 150,
fill: '#ffffff'
@@ -72,13 +73,16 @@
hero.x = 2048 / 2;
hero.y = 2732 / 2;
self.targetPos = null;
stage.on('down', function (obj) {
+ canMove = true;
hero.targetPos = obj.event.getLocalPosition(self);
});
stage.on('move', function (obj) {
if (stage.isDown) {
hero.targetPos = obj.event.getLocalPosition(self);
+ } else {
+ canMove = false;
}
});
var spawnEnemy = function () {
var side = Math.floor(Math.random() * 4);
pixel art cross with blue accents Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of a white orb. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of a white orb with a halo. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of a pulsating white heart with a halo. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of a dark goo projectile with red highlights. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art tall blue fireball. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of an evil fantasy sword facing downward. Minor red details. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
backgroundAmbient
Sound effect
heroHealed
Sound effect
pickupExperience
Sound effect
heroLeveled
Sound effect
weaponCrossImpact
Sound effect
heroImpact
Sound effect
enemyDeath
Sound effect
pickupWeapon
Sound effect
pickupCrucifix
Sound effect
weaponCrossLaunch
Sound effect
heroDeath
Sound effect
enemyRoar
Sound effect
clockChime
Sound effect