User prompt
add a small flash of text that says “+1” every time there is a score
User prompt
Change the background to a basketball court
User prompt
Make each obstacle have its own radius of damage
User prompt
Make obstacles move in randomly sized circular patterns
User prompt
Allow obstacles to move both clockwise and counterclockwise
User prompt
Obstacles must initially appear at least 3 squares away from the ball
User prompt
Randomize obstacle positions
User prompt
Spread out the obstacles more
User prompt
Make the obstacles only move around inside of the screen limit
User prompt
Make each obstacle move asynchronously
User prompt
Make 9 more obstacles
User prompt
Make the obstacles move around the screen
User prompt
Add obstacles that end the game when hit
User prompt
Randomize the position of the goal each game
Initial prompt
Basketball Bangers
===================================================================
--- original.js
+++ change.js
@@ -58,10 +58,12 @@
var hoop = game.addChild(new Hoop());
var obstacles = [];
for (var i = 0; i < 10; i++) {
var obstacle = game.addChild(new Obstacle());
- obstacle.x = Math.random() * game.width;
- obstacle.y = Math.random() * game.height;
+ do {
+ obstacle.x = Math.random() * game.width;
+ obstacle.y = Math.random() * game.height;
+ } while (Math.abs(obstacle.x - ball.x) < 300 || Math.abs(obstacle.y - ball.y) < 300);
obstacles.push(obstacle);
}
var scoreTxt = new Text2('0', {
size: 150,