User prompt
don't change hasJumped when player hits a bell
User prompt
never reset hasJumped
User prompt
Allow jump on player regardless of y. However only allow jumping once
User prompt
move down groundGraphics by 75px
User prompt
For initial player.y subtract 50px
User prompt
Move up player.y by 50px
User prompt
Add a layer after forestGraphics called groundLayer. Add a ground graphics to this one. And attach it to self before foreground
User prompt
Add a layer after forestGraphics called groundLayer
User prompt
Add a layer before valley called mountains
User prompt
add child valley to self when creating it
User prompt
Add a layer before forest called valley with speed .15
User prompt
set forest layer speed to .3
Code edit (1 edits merged)
Please save this source code
User prompt
call setParallaxY on all layers with the value you are currently using
User prompt
In game Create a layers array which you add all layers to
User prompt
When creating the forest layer, parse along .5 as speed
User prompt
Make sure ParallaxLayer is an argument on the ParallaxLayer constructor
User prompt
in ParallaxLayer accept a speed variable. Default to 1 if it's undefined
User prompt
in ParallaxLayer accept a speed variable. Default to 1 if it's undefined
User prompt
for the forest layer set speed to .5
User prompt
set forestGraphics anchor y to 1
User prompt
use forestGraphics rather than background as the asset id
User prompt
set forestGraphics y to hight of game
User prompt
Fix Bug: 'ReferenceError: Can't find variable: background' in this line: 'forest.addChild(background);' Line Number: 44
User prompt
rename the background layer to forestGraphics and center it as well
===================================================================
--- original.js
+++ change.js
@@ -20,8 +20,9 @@
self.hasJumped = false;
self.jump = function () {
if (!self.hasJumped) {
self.speedy = -60;
+ self.hasJumped = true;
}
};
self.fall = function () {};
self.update = function () {
@@ -107,9 +108,8 @@
for (var i = 0; i < bells.length; i++) {
bells[i].move();
if (player.intersects(bells[i])) {
player.speedy = -60;
- player.hasJumped = false;
bells[i].destroy();
bells.splice(i, 1);
self.addBell();
}
Tree line of snowy pine trees. Cartoon. Black background. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Mountain valley with snowy trees. Scenic view. Nighttime. Cartoon. Black background. New moon Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Background mountains, nighttime, snow topped Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
2d platform snowy ground. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Cute cartoon rabbit, jumping upwards facing camera. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Starry night sky, northern lights, looking up. Cartoon style. Above clouds Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Single White Christmas bell. White decorations. Cartoon. Outline Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
White Simple Cartoon snowflake Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.