Code edit (1 edits merged)
Please save this source code
User prompt
Hand should increase and decrease its size
User prompt
Hand should increase and decrease size like the star
User prompt
Make hand less shiny
Code edit (2 edits merged)
Please save this source code
User prompt
Hand should increase and decrease its size on tick
User prompt
Make sure hand scales on tick
User prompt
Hand should also increase and decrease it size on tick
User prompt
Update scale hand on tick
Code edit (1 edits merged)
Please save this source code
User prompt
Decrease size of hand every time the dot bounces on it. Increase it back to normal after it.
Code edit (10 edits merged)
Please save this source code
User prompt
add a new condition for a new speed for obstacles and start to move downwards when dot y < 1700. Double the speed.
User prompt
withoud modifying the current behaviour, if dot reaches center of the screen, then move obstacles and start downards twice as fast. do not impact how they move on the bottom half of the screen.
User prompt
withoud modifying the current behaviour, if dot reaches center of the screen, then move obstacles and start downwards twice as fast. do not impact how they move on the bottom half of the screen.
User prompt
add a new condition that does not affect the current game behaviour. if dot.y < 1400 then double start and obstacle movedown speed.
User prompt
the higher the dot is the fastest the move down speed for star and obstacle should be
Code edit (1 edits merged)
Please save this source code
User prompt
console log speedmultiplier
User prompt
make sure movedown function get updated parameter of dot.y position
User prompt
Update the tick event listener to pass the updated dot.y position to the moveDown method of stars.
Code edit (3 edits merged)
Please save this source code
User prompt
dot can't go higer than 2/3 of the screen
User prompt
dot cant be below y = 1000
Code edit (2 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -206,9 +206,8 @@
self.moveDown = function (distance) {
self.y += distance * 2;
};
});
-// Add Hand asset below the dot with scaling behavior
var Hand = Container.expand(function () {
var self = Container.call(this);
var handGraphics = self.attachAsset('hand', {
anchorX: 0.5,
@@ -218,12 +217,9 @@
self.scaleDirection = 1;
self.scaleSpeed = 0.005;
self.minScale = 0.8;
self.maxScale = 1.2;
- self.update = function (distance) {
- if (distance) {
- self.y += distance;
- }
+ self.update = function () {
if (self.scaleDirection === 1 && handGraphics.scale.x < self.maxScale) {
handGraphics.scale.x += self.scaleSpeed;
handGraphics.scale.y += self.scaleSpeed;
} else if (self.scaleDirection === -1 && handGraphics.scale.x > self.minScale) {
@@ -246,8 +242,13 @@
/****
* Game Code
****/
// Initialize the offscreen threshold for destroying obstacles
+LK.on('tick', function () {
+ if (hand) {
+ hand.update();
+ }
+});
var offscreenThreshold = 2732 + 1000;
function createParticleEffect(x, y) {
var effect = new ParticleEffect(x, y);
LK.on('tick', function () {