Code edit (5 edits merged)
Please save this source code
User prompt
ok, now prevent clicks in result state during the first 2 seconds
Code edit (1 edits merged)
Please save this source code
User prompt
adapt the MovingTarget class to use the new arguments
User prompt
remove local revert in initNewRoundState set directly currentTargetRevert instead
User prompt
use currentTargetRevert instead of revert in initNewRoundState
Code edit (1 edits merged)
Please save this source code
User prompt
TargetManager is duplicated
User prompt
remove the two `targetManager = new TargetManager();`
User prompt
in getNextStartCorner use TargetManager instead of targetManager
User prompt
Please fix the bug: 'TypeError: TargetManager is not a constructor' in or related to this line: 'targetManager = new TargetManager();' Line Number: 300
User prompt
Please fix the bug: 'TypeError: TargetManager is not a constructor' in or related to this line: 'targetManager = new TargetManager();' Line Number: 300
User prompt
Please fix the bug: 'TypeError: TargetManager is not a constructor' in or related to this line: 'var targetManager = new TargetManager();' Line Number: 300
User prompt
Please fix the bug: 'ReferenceError: targetManager is not defined' in or related to this line: 'var availableCorners = targetManager.getTarget(asset).startCorners;' Line Number: 365
User prompt
Ok now we gonna change the target initialisation process that essentially stand in initNewRoundState : 1) define a local boolean 'revert' with random value 2) set currentTargetAsset using levelManager.getTarget(); 3) set currentTarget as a new instance of MovingTarget but now passing currentTargetAsset and revert as parameters. MovingTarget will use those parameters instead of calling getTarget() itself. 4) set startCornerIndex will be defined using positionManager.getNextStartCorner(currentTargetAsset, revert); getNextStartCorner will use TargetManager with the asset parameter to get available start corners and use revert to filter possible start corners (false : 1,2,6,7,8 / true => 2,3,4,5,6) then return a random start corner within the intersection of the arrays.
Code edit (1 edits merged)
Please save this source code
User prompt
Fill TargetManager.targets, refer to current LevelManager data
Code edit (4 edits merged)
Please save this source code
User prompt
create a TargetManager class with the following properties: * targets = { // List of all available targets 'bird1' : { // Asset Name as the key asssetName : 'bird1', // Name of the asset startCorners : [5,7], // list of possible start corner indexes } }; and the following methods * getTarget(key){ /* Returns the target with the key (aka this.targets[key]) */ } * getAllKeys() { /* Returns the list of the keys of available target (aka Object.keys(this.targets)) */ }
Code edit (7 edits merged)
Please save this source code
User prompt
if endPosition.x is < startPosition.x, change the scale of the target to -1
Code edit (2 edits merged)
Please save this source code
User prompt
for Check if the target is out of the screen bounds with an offset, also check if th distance is below the offset
User prompt
in MovingTarget, reduce the logging rate of the position
Code edit (1 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -496,9 +496,9 @@
// UI variables
var scoreTxt;
var readyText;
// Debug variables
-var isDebug = true;
+var isDebug = false;
var debugMarker;
var debugText;
/****************************************************************************************** */
/*********************************** UTILITY FUNCTIONS ************************************ */
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