User prompt
create a technical class named LevelManager responsible of providing the name of the assets to use for the background and the targets for each level and each round
User prompt
replace 0xAEC6CF by 0x8FA9B9
User prompt
replace 0xAEC6CF by 0xB2C4CF
Code edit (1 edits merged)
Please save this source code
User prompt
Changez la couleur du texte prêt à l'écran à blanc.
Code edit (5 edits merged)
Please save this source code
User prompt
use score text options for result text
Code edit (1 edits merged)
Please save this source code
User prompt
add , weight: 1000, dropShadow: true to score text
User prompt
use 0x283d3b for score color
User prompt
use 0x197278 for score color
User prompt
replace 0xAEC6CF by 0x2D454D
User prompt
add a percentage after the score
User prompt
Replace the label score by quality.
User prompt
Replace the label Listen by Get Ready.
User prompt
Move the ready text to the top of the screen.
User prompt
Ne pas mettre le score visible dans New Run State Cleaning, mais dans Init Result State.
User prompt
Hide score during new round state
Code edit (1 edits merged)
Please save this source code
User prompt
En état de résultat propre, couvrez le cadre de photo et l'ombre de photo.
Code edit (16 edits merged)
Please save this source code
User prompt
Mettez le bouton d'affichage visible dans InitNewRound, pas dans CleanResultState.
Code edit (2 edits merged)
Please save this source code
User prompt
set size of shadowCorner to 40x40 and alpha to 0.5
User prompt
add one shadowCorner asset to the PhotoFrameShadow
===================================================================
--- original.js
+++ change.js
@@ -103,10 +103,10 @@
/********************************** MOVING TARGET CLASS ************************************/
/***********************************************************************************/
var MovingTarget = Container.expand(function () {
var self = Container.call(this);
- var birdAssets = ['bird1', 'bird2', 'bird3'];
- currentTargetAsset = birdAssets[Math.floor(Math.random() * birdAssets.length)];
+ var targets = levelManager.getTargets();
+ currentTargetAsset = targets[Math.floor(Math.random() * targets.length)];
var targetGraphics = self.attachAsset(currentTargetAsset, {
anchorX: 0.5,
anchorY: 0.5
});
@@ -247,12 +247,45 @@
/****
* Game Code
****/
+/***********************************************************************************/
+/********************************** LEVEL MANAGER CLASS ****************************/
+/***********************************************************************************/
/****************************************************************************************** */
/************************************** GLOBAL VARIABLES ********************************** */
/****************************************************************************************** */
// Enumeration for game states
+var LevelManager = function LevelManager() {
+ this.levels = [{
+ background: 'background1',
+ targets: ['bird1', 'bird2']
+ }, {
+ background: 'background2',
+ targets: ['bird3', 'bird1']
+ }, {
+ background: 'background3',
+ targets: ['bird2', 'bird3']
+ }];
+ this.currentLevel = 0;
+ this.currentRound = 0;
+};
+LevelManager.prototype.getBackground = function () {
+ return this.levels[this.currentLevel].background;
+};
+LevelManager.prototype.getTargets = function () {
+ return this.levels[this.currentLevel].targets;
+};
+LevelManager.prototype.nextRound = function () {
+ this.currentRound++;
+ if (this.currentRound >= this.levels[this.currentLevel].targets.length) {
+ this.currentRound = 0;
+ this.currentLevel++;
+ if (this.currentLevel >= this.levels.length) {
+ this.currentLevel = 0; // Loop back to the first level
+ }
+ }
+};
var GAME_STATE = {
INIT: 'INIT',
NEW_ROUND: 'NEW_ROUND',
PLAYING: 'PLAYING',
@@ -349,8 +382,9 @@
/************************************* GAME STATES **************************************** */
/****************************************************************************************** */
function gameInitialize() {
log("Game initialize...");
+ var levelManager = new LevelManager();
background = LK.getAsset('background', {
anchorX: 0,
anchorY: 0,
x: 0,
@@ -418,8 +452,14 @@
}
/**************************************** NEW ROUND STATE *********************************/
function initNewRoundState() {
log("initNewRoundState...");
+ background = LK.getAsset(levelManager.getBackground(), {
+ anchorX: 0,
+ anchorY: 0,
+ x: 0,
+ y: 0
+ });
background.visible = true;
gameState = GAME_STATE.NEW_ROUND;
// TODO : handle Level change and target change
currentTarget = new MovingTarget();
@@ -503,8 +543,9 @@
}
function cleanResultState() {
log("cleanResultState...");
frameMask.visible = false;
+ levelManager.nextRound();
scoreTxt.visible = false;
photoFrameBackground.visible = false;
photoFrame.visible = false;
photoFrameShadow.visible = false;
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