User prompt
make a clock counting down from 60 seconds top centre of screen
Code edit (1 edits merged)
Please save this source code
User prompt
ball speed should slow slightly down towards starting speed each frame
Code edit (1 edits merged)
Please save this source code
User prompt
each succesfull collision should give the alls a temporary speed boost in the proper direction
User prompt
determinehitside should compare proximity of ball and bat edges to determine actual collision side
User prompt
determinehitside currently never returns top or bottom
Code edit (1 edits merged)
Please save this source code
User prompt
when balls collide with up and down sides of bat, their vy should change accordingly
User prompt
Fix Bug: 'ReferenceError: reflectBall is not defined' in this line: 'reflectBall(balls[i], hitSide);' Line Number: 85
User prompt
Fix Bug: 'ReferenceError: determineHitSide is not defined' in this line: 'var hitSide = determineHitSide(ballBounds, batBounds);' Line Number: 73
User prompt
Fix Bug: 'TypeError: batBounds.intersects is not a function' in this line: 'if (batBounds.intersects(ballBounds)) {' Line Number: 71
User prompt
collisionwise, the bat has four sides: up, down, left and right
User prompt
both vx and vy should be calculated on ball bat collision, so that the ball is deflected at an angle corresponsing to it's impact angle
User prompt
max number of balls on stage should be 20
User prompt
balls should spawn at least 200 pixels inside game area
User prompt
ball direction should not be within 7 degrees of 0, 90, 180 or 270 degrees
User prompt
balls should only allow 1 collision with bat per 0.5 second
User prompt
balls should move at a fixed speed in a random direction, bouncing on window borders and on bat collision
User prompt
every 2 seconds create a new ball, which is either red, blue, green or yellow
User prompt
bat scale 2
User prompt
bat should follow pointer both on x and y
User prompt
bat shold follow pointer movement
User prompt
bat should move freely following mouse
Initial prompt
Square Ball
===================================================================
--- original.js
+++ change.js
@@ -101,6 +101,20 @@
var pos = obj.event.getLocalPosition(self);
bat.x = pos.x;
bat.y = pos.y;
});
+ var countdownClock = new Text2('60', {
+ size: 150,
+ fill: "#ffffff"
+ });
+ countdownClock.anchor.set(.5, 0);
+ LK.gui.topCenter.addChild(countdownClock);
+ var countdownTime = 60;
+ var countdownInterval = LK.setInterval(function () {
+ countdownTime--;
+ countdownClock.setText(countdownTime.toString());
+ if (countdownTime <= 0) {
+ LK.clearInterval(countdownInterval);
+ }
+ }, 1000);
setup();
});
raspberry Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
lemon slice. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
black currant. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
green apple. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
yellow plastic tray. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
green plastic tray. topdown view. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
blue plastic tray. topdown view. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
red plastic tray. topdown view. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
top down forest clearing with small bushes.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
lighter color blue.
A little farmer that is comically square shaped.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.