Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
User prompt
make this line work: ballGraphics.texture = LK.getAsset('newDeathSpriteId', {}).texture;
User prompt
Fix Bug: 'TypeError: ballGraphics.setTextureFromAsset is not a function' in or related to this line: '_iterator.f();' Line Number: 429
User prompt
Fix Bug: 'TypeError: ballGraphics.setTexture is not a function' in or related to this line: '_iterator.f();' Line Number: 429
User prompt
in the deathanim function, ball sprite should change to another one.
Code edit (10 edits merged)
Please save this source code
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'setText')' in or related to this line: '_iterator.f();' Line Number: 466
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'setText')' in or related to this line: '_iterator.f();' Line Number: 466
Code edit (1 edits merged)
Please save this source code
User prompt
Every time the player gets points, they should be multiplied by the variable (multiplier-1).
User prompt
Every time the player gets points, they should be multiplied by the variable (multiplier-1).
Code edit (1 edits merged)
Please save this source code
Code edit (7 edits merged)
Please save this source code
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'toString')' in or related to this line: 'mulText.setText('x' + newVal.toString());' Line Number: 176
User prompt
Fix Bug: 'ReferenceError: valText is not defined' in or related to this line: 'valText.anchor.set(0.5, 0.5);' Line Number: 173
Code edit (3 edits merged)
Please save this source code
User prompt
scorelabels should fly off in a random upwards direction instead of just up.
Code edit (1 edits merged)
Please save this source code
User prompt
add all created scorelabels to the scoreLabels array on creation.
Code edit (1 edits merged)
Please save this source code
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'update')' in or related to this line: 'self.scoreLabel.update();' Line Number: 323
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'update')' in or related to this line: 'self.scoreLabel.update();' Line Number: 323
Code edit (1 edits merged)
Please save this source code
User prompt
call the scorelabel's update method in the on tick loop, or in ball update
===================================================================
--- original.js
+++ change.js
@@ -33,43 +33,27 @@
/*
TODO:
--------------------
Bugs:
-When you hit a times something multiplier powerup, all other multiplier powerups should increment their labels accordingly,
-for consistence.
-Multiplier powerups should be effective immediately, in order to make sanse to the player, not only when next score is given.
-The red platforms have to be really shining up in red, dangerous looking.
+The red platforms have to be really shining up in red, dangerous looking. maybe add spikes.
Now that player graphic is bigger, it sometimes collides with platforms from below. Either adjust size, spacing
or jump height/logic.
The platforms array grows in length over time. Try to remove deleted elements from it, but make backup first,
because this is where the AI started optimizing to make the game page freeze last time.
-Maybe remove the immunity from normal powerups, it's confusing.
---------------------
Interface/graphics:
Show instructions on screen at start.
-Maybe tint platforms based on their overall depth.
-Consider smileyfaces on the platforms - angry ones on the red ones.
When player dies, maybe make them fall out of screen, facing player, screaming, waving hands, like in the old
Rick Dangerous games for Amiga.
--------------
Powerup ideas:
-A powerup that permanently increments the score for hitting a standard platform by 1.
A powerup that removes all nearby platforms and give score for them.
Maybe make a disco powerup that changes light, colors or visuals somehow.
-Consider a score multiplier powerup - either where player's score is instantly doubled,
-or where score for each following platform hit is doubled.
Consider platforms that increase or decrease the size/weight of the character.
-Like a powerup platform that turns the player into a squirrel, no bouncing, just running and falling off platforms,
-changing direction on player click. (But players would probably die from this, killing the joke?)
Or maybe just a platform with a piece of cake on it, and when player lands there he gets 10 points and swells up
(no gameplay side effects) for 5 seconds. Could actually be all kinds of funny pickups like that.
A beer that inverses controls (but again, players will be frustrated by rapid changes)
-A companion character that follows you with a slight delay. Maybe a dog or bird that can be delivered to a dog house
-or cage or a tree/forest on a deeper platform for points?
Or different hats that the player will wear until a new one is picked up?
-There could be a scene just before gameover, showing how many dogs were saved, how many cakes were eaten,
-how many hats were worn, etc. Or a festive explosion of all the items and platforms the player touched
-during the game.
----------
Gameplay:
Consider difficulty ramping. More red platforms?
Make sure red platforms never fully block the way. Probably means platforms should have row-id's, so rows can be checked.
@@ -164,11 +148,11 @@
self.toxic = false;
self.powerup = true;
self.powerupType = "Multiply";
self.collidable = true;
- self.velocityBoost = 50;
+ self.velocityBoost = 25;
self.immunityBoost = 0;
- self.scoreBoost = 10;
+ self.scoreBoost = 1;
var mulText = new Text2('+1', {
size: 50,
fill: "#ffffff",
outline: true
@@ -188,10 +172,10 @@
self.powerup = true;
self.powerupType = "Follow";
self.followActivated = false;
self.collidable = true;
- self.velocityBoost = 50;
- self.immunityBoost = 1;
+ self.velocityBoost = 25;
+ self.immunityBoost = 0;
self.scoreBoost = 10;
self.vely = 1;
self.freeGraphicName = 'powerupFollowFree';
self.update = function () {
@@ -224,10 +208,10 @@
self.powerupType = "Follow";
self.freeGraphicName = "bluebirdFreeGraphic";
self.followActivated = false;
self.collidable = true;
- self.velocityBoost = 50;
- self.immunityBoost = 1;
+ self.velocityBoost = 25; //50;
+ self.immunityBoost = 0;
self.scoreBoost = 20;
self.vely = 1;
self.update = function () {
if (this.followActivated) {
@@ -259,10 +243,10 @@
self.powerupType = "Follow";
self.freeGraphicName = "greenbirdFreeGraphic";
self.followActivated = false;
self.collidable = true;
- self.velocityBoost = 50;
- self.immunityBoost = 1;
+ self.velocityBoost = 25;
+ self.immunityBoost = 0;
self.scoreBoost = 30;
self.vely = 1;
self.update = function () {
if (this.followActivated) {
@@ -294,9 +278,9 @@
self.powerupType = "Score";
self.collidable = true;
self.scoreVal = 0;
self.velocityBoost = 25;
- self.immunityBoost = 3;
+ self.immunityBoost = 0;
self.scoreBoost = 0;
var valText = new Text2('0', {
size: 50,
fill: "#000000",
@@ -309,28 +293,8 @@
self.scoreBoost = newVal;
};
self.updateLabel(self.scoreVal);
});
-// Platform class to create movable platforms
-var SideBarrier = Container.expand(function () {
- var self = Container.call(this);
- var sideBarrierGraphics = self.attachAsset('sideBarrier', {
- anchorX: 0.5,
- anchorY: 0.5
- });
- self.width = 300;
- self.height = 300;
- self.toxic = false;
- self.row = 0;
- self.col = 0;
- self.powerup = false;
- self.collidable = false;
- // Set platform tint based on toxicity
- self.setTint = function () {
- self.tint = sideBarrierGraphics.tint = self.toxic ? 0xff0000 : 0xff0101;
- };
- this.setTint();
-});
// Ball class to create the bouncing ball
var Ball = Container.expand(function () {
var self = Container.call(this);
var ballGraphics = self.attachAsset('ball', {
@@ -388,8 +352,12 @@
}
break;
}
if (platform.toxic) {
+ ballGraphics.setTexture(LK.getAsset('newDeathSpriteId', {
+ width: ballGraphics.width,
+ height: ballGraphics.height
+ }));
LK.showGameOver();
break;
}
//self.velocity.y = -20;
@@ -403,15 +371,17 @@
if (platform.powerupType == "Multiply") {
multiplier++;
}
platform.alpha = 0;
- var scoreIncrement = multiplier - 1;
- LK.setScore(LK.getScore() + scoreIncrement);
- // Create and display score label
- var scoreLabel = new ScoreLabel(scoreIncrement, self.x, self.y);
- scoreLabel.updateScore(scoreIncrement);
- scoreLabels.push(scoreLabel);
- game.addChild(scoreLabel);
+ if (platform.powerup == false) {
+ var scoreIncrement = multiplier - 1;
+ LK.setScore(LK.getScore() + scoreIncrement);
+ // Create and display score label
+ var scoreLabel = new ScoreLabel(scoreIncrement, self.x, self.y);
+ scoreLabel.updateScore(scoreIncrement);
+ scoreLabels.push(scoreLabel);
+ game.addChild(scoreLabel);
+ }
if (platform.powerup == true) {
//self.velocity.y = 50;
self.velocity.y = platform.velocityBoost;
//self.immunity = 10;
@@ -471,10 +441,11 @@
/****
* Game Code
****/
-// Initialize background graphic asset
+//LK.init.shape('sideBarrier', {width:100, height:100, color:0xff0000, shape:'box'})
// Create background graphic and add it to the game
+// Initialize background graphic asset
var backgroundGraphic = game.addChild(LK.getAsset('background', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
A happy blue elephant.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
erase.
Make the bird sit inside a birdcage.
Three green arrows pointing down.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A sad little bluebird sitting down.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A happy little bluebird flying.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A happy little green bird flying.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A lush jungle scenery with huge old trees covered in vines and overwrowth, blue sky and forested mountains in the background.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A dark wooden message board with vines and jungle moss growing on top.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A happy little blue elephant, looking scared, facing the viewer, legs flailing as it falls through the air.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A delicious peanut.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
delete