Code edit (1 edits merged)
Please save this source code
User prompt
move puzzleManager.initPuzzle(); in initNewRound
User prompt
add 3 global containers layers
User prompt
add 3 global containers layers for background, middle and foreground
User prompt
Initialization of globals shoud come in initialzeGame
Code edit (1 edits merged)
Please save this source code
User prompt
center start button
User prompt
add 2 globals for centerX and centerY and use them
Code edit (1 edits merged)
Please save this source code
User prompt
in each event handler, add a switch on currentState for Menu, Playing and Score
User prompt
for each case in event handlers create a corresponding function. ie: for case GAME_STATE.MENU in game.down create and call handleMenuStateDown()
Code edit (2 edits merged)
Please save this source code
User prompt
on tap in menu state switch to new round state
User prompt
in cleanMenuState, remove the start button
User prompt
create a container for the board
User prompt
create a container for the board. Respect current code style and convention.
User prompt
create a container for the board. Respect code style and convention: globals declaration under global variables section, initialization in initialazeGame function...
User prompt
add the boadContainer in middleLayer and add tiles to the boardContainer
User prompt
center the board and the tiles
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'initialTiles')' in or related to this line: 'var tileGraphics = self.attachAsset('hexTile', {' Line Number: 26
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'initialTiles')' in or related to this line: 'var tileGraphics = self.attachAsset('hexTile', {' Line Number: 26
User prompt
move operations buttons to the bottom center of the screen
User prompt
remove valueText
User prompt
in init menu, if debug automatically change to newRound state
Code edit (1 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -85,8 +85,44 @@
/****
* Game Code
****/
+function handleScoreStateUp(x, y, obj) {
+ // Implement logic for handling up event in SCORE state
+ log("Handling up event in SCORE state");
+}
+function handlePlayingStateUp(x, y, obj) {
+ // Implement logic for handling up event in PLAYING state
+ log("Handling up event in PLAYING state");
+}
+function handleMenuStateUp(x, y, obj) {
+ // Implement logic for handling up event in MENU state
+ log("Handling up event in MENU state");
+}
+function handleScoreStateMove(x, y, obj) {
+ // Implement logic for handling move event in SCORE state
+ log("Handling move event in SCORE state");
+}
+function handlePlayingStateMove(x, y, obj) {
+ // Implement logic for handling move event in PLAYING state
+ log("Handling move event in PLAYING state");
+}
+function handleMenuStateMove(x, y, obj) {
+ // Implement logic for handling move event in MENU state
+ log("Handling move event in MENU state");
+}
+function handleScoreStateDown(x, y, obj) {
+ // Implement logic for handling down event in SCORE state
+ log("Handling down event in SCORE state");
+}
+function handlePlayingStateDown(x, y, obj) {
+ // Implement logic for handling down event in PLAYING state
+ log("Handling down event in PLAYING state");
+}
+function handleMenuStateDown(x, y, obj) {
+ // Implement logic for handling down event in MENU state
+ log("Handling down event in MENU state");
+}
/***********************************************************************************************/
/************************************* GAME OBJECTS CLASSES ************************************/
/***********************************************************************************************/
function PuzzleManager(game) {
@@ -387,45 +423,45 @@
/***********************************************************************************************/
game.down = function (x, y, obj) {
switch (currentState) {
case GAME_STATE.MENU:
- // Handle operation button drag start in MENU state
+ handleMenuStateDown(x, y, obj);
break;
case GAME_STATE.PLAYING:
- // Handle operation button drag start in PLAYING state
+ handlePlayingStateDown(x, y, obj);
break;
case GAME_STATE.SCORE:
- // Handle operation button drag start in SCORE state
+ handleScoreStateDown(x, y, obj);
break;
default:
log("Unknown state:", currentState);
}
};
game.move = function (x, y, obj) {
switch (currentState) {
case GAME_STATE.MENU:
- // Handle operation button drag movement in MENU state
+ handleMenuStateMove(x, y, obj);
break;
case GAME_STATE.PLAYING:
- // Handle operation button drag movement in PLAYING state
+ handlePlayingStateMove(x, y, obj);
break;
case GAME_STATE.SCORE:
- // Handle operation button drag movement in SCORE state
+ handleScoreStateMove(x, y, obj);
break;
default:
log("Unknown state:", currentState);
}
};
game.up = function (x, y, obj) {
switch (currentState) {
case GAME_STATE.MENU:
- // Handle operation button drag end in MENU state
+ handleMenuStateUp(x, y, obj);
break;
case GAME_STATE.PLAYING:
- // Handle operation button drag end in PLAYING state
+ handlePlayingStateUp(x, y, obj);
break;
case GAME_STATE.SCORE:
- // Handle operation button drag end in SCORE state
+ handleScoreStateUp(x, y, obj);
break;
default:
log("Unknown state:", currentState);
}
tick
Sound effect
tileEntrance
Sound effect
tileRemove
Sound effect
operationSelect
Sound effect
operationCancel
Sound effect
tileChangeValue
Sound effect
resetSound
Sound effect
levelFailed
Sound effect
menuLevelSelect
Sound effect
menuCellEnter
Sound effect
applause
Sound effect
bgMusic
Music
tada
Sound effect