User prompt
Adapt the MovingTarget class to handle all new cases of going out of screen
User prompt
adapt the PositionManager offset so that start and end position are always out of the screen (kwown that targets have a size of 1024x1024)
User prompt
use the PositionManager
Code edit (1 edits merged)
Please save this source code
User prompt
create a PositionManager class with the following properties: * previousStartCornerIndex * nbMaxCorners = 8;// Constant and the following methods * getNextStartCorner(){ /* Returns a random index between 1 and nbMaxCorners and different from previousStartCornerIndex. Stores the selected index in previousStartCornerIndex */ } * getEndCorner(startCornerIndex) { /* Returns a random possible arrival corners from the startCornerIndex provided. for each startCornerIndex there are 3 possible arrival corners: 1+(startCornerIndex+2)%9, 1+(startCornerIndex+3)%9 and 1+(startCornerIndex+4)%9 ie: 1 => 4,5,6 / 2 => 5,6,7 / ... */ } * getCornerPosition(cornerIndex) { /* Returns a couple a coordinates {x, y} of the cornerIndex. 1 => {x: xMin - randomOffset, y: yMin } 2 => {x: xMin , y: yMin - randomOffset } 3 => {x: xMax , y: yMin - randomOffset } 4 => {x: xMax + randomOffset, y: yMin } 5 => {x: xMax + randomOffset, y: yMax } 6 => {x: xMax , y: yMax + randomOffset } 7 => {x: xMin , y: yMax + randomOffset} 8 => {x: xMin - randomOffset, y: yMax } */ }
User prompt
When score is 0, replace the text by "Missed!"
Code edit (9 edits merged)
Please save this source code
User prompt
reset targetShotX and targetShotY at each new round
User prompt
don't cumulate the score
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: t is undefined' in or related to this line: 'var targetGraphics = self.attachAsset(currentTargetAsset, {' Line Number: 138
Code edit (1 edits merged)
Please save this source code
User prompt
in MovingTarget log the currentTargetAsset and levelManager.currentRound
Code edit (1 edits merged)
Please save this source code
User prompt
replace the use of currentLevel global by levelManager.currentLevel
User prompt
don't use random for targets selection, use current round index
User prompt
Please fix the bug: 'TypeError: this.levels[this.currentLevel] is undefined' in or related to this line: 'if (this.currentRound > this.levels[this.currentLevel].targets.length) {' Line Number: 323
User prompt
in LevelManager set currentLevel & currentRound to -1 initally
User prompt
in initNewRoundState write the new level and round numbers in debugtext
Code edit (1 edits merged)
Please save this source code
User prompt
set cameraHUD visible in initNewRoundState
Code edit (3 edits merged)
Please save this source code
User prompt
re-add the CameraHUD in the initNewRoundState
User prompt
re-add background to backgroundLayer in initNewRoundState
Code edit (6 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -129,9 +129,10 @@
var dy = self.endY - self.y;
var distance = Math.sqrt(dx * dx + dy * dy);
self.x += dx / distance * self.speedX;
self.y += dy / distance * self.speedX;
- if (self.x > 2048 + self.width) {
+ // Check if the target is out of the screen bounds
+ if (self.x < -self.width || self.x > 2048 + self.width || self.y < -self.height || self.y > 2732 + self.height) {
self.destroy();
cleanPlayingState();
initResultState();
}
a forest.
flying Red-bellied Woodpecker.
flying Yellow-headed Blackbird.
flying Painted Bunting.
Underwater. only water and corals. NO animals
Countryside. 1 flower in foreground.
A Butterfly flying.
a fish swimming.
full dragonfly flying to the right.
full drone flying to the right.
a full hot air balloon with a basket flying to the right.
roofs of an empty modern city. day light
a satellite.
stary dark space. NO OBJECTS
a multitude of polaroids in bulk, with photos of birds, fishes, butterflies, planes, hot air baloons, satelites, dragonflies.....
A flying owl.
A flying parrot.
hippocampe.
shark. lateral view
diodon hystrix swimming. lateral view
fighting fish swimming. lateral view
a hang glider flying. full lateral view
un cerf-volant multicolore.
une coccinelle volante.
un scarabée vert irisé volant. side view
une gueppe volante. side view
un astronaute volant. full side view
une navette spaciale volante. full side view
un astéroïde volant dans l'espace. full side view
remove