User prompt
Black background
User prompt
Make a mushroom power up to give me an extra life
User prompt
Make Joy con stick controller to move the character
User prompt
Make the fireballs The skull
User prompt
Make the fireball transform you and make you shoot fires balls by tapping two times
User prompt
Please fix the bug: 'ReferenceError: Can't find variable: fireBalls' in or related to this line: 'for (var i = fireBalls.length - 1; i >= 0; i--) {' Line Number: 199
User prompt
Please fix the bug: 'ReferenceError: Can't find variable: firePowerUps' in or related to this line: 'for (var i = firePowerUps.length - 1; i >= 0; i--) {' Line Number: 182
User prompt
Make a fire power up that can throw fireballs at the skulls to make them disappear
User prompt
Make mushroom power ups
User prompt
Make the background a court
User prompt
Make the background a beach
Initial prompt
Slimy basketball
===================================================================
--- original.js
+++ change.js
@@ -1,7 +1,30 @@
/****
* Classes
****/
+// Class for the fire balls
+var FireBall = Container.expand(function () {
+ var self = Container.call(this);
+ var fireBallGraphics = self.attachAsset('fireBall', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.speed = -5;
+ self.update = function () {
+ self.y += self.speed;
+ };
+});
+// Class for the fire power ups
+var FirePowerUp = Container.expand(function () {
+ var self = Container.call(this);
+ var firePowerUpGraphics = self.attachAsset('firePowerUp', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.update = function () {
+ // Add any update logic for the fire power up here
+ };
+});
// Class for the hoops
var Hoop = Container.expand(function () {
var self = Container.call(this);
var hoopGraphics = self.attachAsset('hoop', {
@@ -118,8 +141,15 @@
newMushroom.y = -100;
mushrooms.push(newMushroom);
game.addChild(newMushroom);
}, 5000);
+var firePowerUpInterval = LK.setInterval(function () {
+ var newFirePowerUp = new FirePowerUp();
+ newFirePowerUp.x = Math.random() * 2048;
+ newFirePowerUp.y = -100;
+ firePowerUps.push(newFirePowerUp);
+ game.addChild(newFirePowerUp);
+}, 7000);
// Update function called every game tick
game.update = function () {
handleScoring();
handleObstacles();
@@ -136,8 +166,40 @@
obstacles[i].destroy();
obstacles.splice(i, 1);
}
}
+ for (var i = firePowerUps.length - 1; i >= 0; i--) {
+ firePowerUps[i].y += 5;
+ if (firePowerUps[i].y > 2732) {
+ firePowerUps[i].destroy();
+ firePowerUps.splice(i, 1);
+ }
+ if (slimyBall.intersects(firePowerUps[i])) {
+ firePowerUps[i].destroy();
+ firePowerUps.splice(i, 1);
+ var newFireBall = new FireBall();
+ newFireBall.x = slimyBall.x;
+ newFireBall.y = slimyBall.y;
+ fireBalls.push(newFireBall);
+ game.addChild(newFireBall);
+ }
+ }
+ for (var i = fireBalls.length - 1; i >= 0; i--) {
+ fireBalls[i].y += 5;
+ if (fireBalls[i].y < 0) {
+ fireBalls[i].destroy();
+ fireBalls.splice(i, 1);
+ }
+ for (var j = obstacles.length - 1; j >= 0; j--) {
+ if (fireBalls[i].intersects(obstacles[j])) {
+ fireBalls[i].destroy();
+ fireBalls.splice(i, 1);
+ obstacles[j].destroy();
+ obstacles.splice(j, 1);
+ break;
+ }
+ }
+ }
};
// Event listeners for touch/mouse events
game.move = handleMove;
game.down = function (x, y, obj) {
3-D slime Person. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Skull. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Basketball. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Fireball. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Mario mushroom. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.