User prompt
if no shapes have isCollided true, check whether collisionCount matches the required number of collisions for the current level. If it does, continue to next level, otherwise, give an option to play the same level again.
User prompt
make an array of 20 game levels, each with more total shapes and a higher number for required collisions to complete that level
User prompt
the stage on down handler should only allow one click from player
User prompt
Fix Bug: 'ReferenceError: collisionCount is not defined' in this line: 'collisionCount++;' Line Number: 142
User prompt
display the collisionscount in a text instance on screen: 'Exploded: ' + collisionCount;
Code edit (2 edits merged)
Please save this source code
User prompt
when shapes scale up, their collision area should scale up as well
User prompt
when shapes collide with a staticshape, they should run the explode function once
Code edit (2 edits merged)
Please save this source code
User prompt
shapes seem to be scaling up faster than staticshapes
User prompt
a shape instance should never trigger a collision with itself
Code edit (2 edits merged)
Please save this source code
User prompt
when shapes scale up, they should do it at the same speed that the static shape scaled up
User prompt
if a shape collides with another shape that is not moving, it should also stop and scale up
User prompt
if a static shape collides with another static shape that is not moving, it should also stop and scale up
User prompt
it should also stop moving on collision
User prompt
if a non-static shape collides with the static shape, it should scale up in the same way, and disappear after 5 seconds in the same way
User prompt
after 5 seconds at scale 4, the staticshape should rapidly scale down to 0 and destroy
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
User prompt
the static shape, when spawned, should scale up to 4 times its original size over 2 seconds
Code edit (2 edits merged)
Please save this source code
User prompt
when player clicks, spawn a shape that doesn't move where he clicked
User prompt
all shapes should move at the same speed regardless of their direction
User prompt
give each shape a random movement direction with velocity 5 and make them move, bouncing on screen edges
===================================================================
--- original.js
+++ change.js
@@ -122,9 +122,24 @@
shapes.forEach(function (shape) {
shape.move();
self.children.forEach(function (child) {
if (child instanceof StaticShape && shape.intersects(child)) {
- shape.explode();
+ if (!child.isScaling) {
+ shape.explode();
+ child.isScaling = true;
+ var scaleUp = function () {
+ if (child.scale.x < 4) {
+ child.scale.x += 0.04;
+ child.scale.y += 0.04;
+ LK.setTimeout(scaleUp, 2);
+ } else {
+ LK.setTimeout(function () {
+ child.isScaling = false;
+ }, 5000);
+ }
+ };
+ LK.setTimeout(scaleUp, 33);
+ }
}
});
});
});
a white geometric square shape Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
a white dot Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
flat white round disk Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
gif circle spinning animation Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.