Code edit (1 edits merged)
Please save this source code
User prompt
in function resetgamefornextlevel, make a few seconds long pause before displaylettersniline is called, and show a message to the player: next level
Code edit (1 edits merged)
Please save this source code
Code edit (2 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught ReferenceError: Lk is not defined' in or related to this line: 'Lk.getSound('correctWord').play();' Line Number: 114
Code edit (5 edits merged)
Please save this source code
User prompt
play the tap sound when a lettertile is tapped
Code edit (8 edits merged)
Please save this source code
User prompt
play the background music when the game starts, and let it repeat until gameover
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught ReferenceError: submitButon is not defined' in or related to this line: 'submitButon.destroy();' Line Number: 293
Code edit (1 edits merged)
Please save this source code
Code edit (16 edits merged)
Please save this source code
User prompt
please implement function gameWon such that it displays a message 'Congratulations! You found all the worrd!' for a few seconds before calling KLshowGameOver.
Code edit (1 edits merged)
Please save this source code
Code edit (8 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught TypeError: letterTilesArr is not a function' in or related to this line: 'letterTilesArr(letterTile);' Line Number: 235
Code edit (1 edits merged)
Please save this source code
Code edit (5 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'anchor')' in or related to this line: 'scoreTxt.anchor.set(0.5, 0);' Line Number: 132
Code edit (2 edits merged)
Please save this source code
User prompt
when a word is correct, remove it from the levels[currentLevel].words array
Code edit (1 edits merged)
Please save this source code
Code edit (15 edits merged)
Please save this source code
User prompt
make a small star explosion on the blackboard when a word is correct
===================================================================
--- original.js
+++ change.js
@@ -1,7 +1,29 @@
/****
* Classes
****/
+var Cat = Container.expand(function () {
+ var self = Container.call(this);
+ var catGraphics = self.attachAsset('cat', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.count = 0;
+ self.down = function (x, y, obj) {
+ self.update = function () {
+ if (self.y > 1550) {
+ self.y -= 10;
+ }
+ self.count++;
+ if (self.count > 90) {
+ self.y = 1700;
+ self.count = 0;
+ self.update = null;
+ }
+ };
+ };
+ return self;
+});
//<Assets used in the game will automatically appear here>
// Class for Letter Tiles
var LetterTile = Container.expand(function () {
var self = Container.call(this);
@@ -31,8 +53,30 @@
}
};
return self;
});
+var Rabbit = Container.expand(function () {
+ var self = Container.call(this);
+ var rabbitGraphics = self.attachAsset('rabbit', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.count = 0;
+ self.down = function (x, y, obj) {
+ self.update = function () {
+ if (self.y > 1550) {
+ self.y -= 10;
+ }
+ self.count++;
+ if (self.count > 90) {
+ self.y = 1700;
+ self.count = 0;
+ self.update = null;
+ }
+ };
+ };
+ return self;
+});
var SubmitButton = Container.expand(function () {
var self = Container.call(this);
var buttonGraphics = self.attachAsset('submitButton', {
anchorX: 0.5,
@@ -163,10 +207,25 @@
anchorY: 0.5,
x: 2048 / 2 - 50,
y: 2732 / 2 - 200
});
-var teacher = new Teacher();
game.addChild(background);
+var rabbit = new Rabbit();
+rabbit.x = 250;
+rabbit.y = 1700;
+game.addChild(rabbit);
+var cat = new Cat();
+cat.x = 2000;
+cat.y = 1700;
+game.addChild(cat);
+var tables = LK.getAsset('tables', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 2048 / 2 - 50,
+ y: 2732 / 2 - 200
+});
+game.addChild(tables);
+var teacher = new Teacher();
teacher.x = 2048 / 2 + 380;
teacher.y = 2732 / 2 - 250;
game.addChild(teacher);
// Function to reset the game state for the new level
@@ -277,15 +336,15 @@
words: ['NAPS', 'SNAP', 'PANS', 'SPAN']
}, {
letters: ['A', 'L', 'R', 'I'],
words: ['LAIR', 'LIAR', 'RAIL']
-}];
-var levels5 = [{
+}, {
letters: ['T', 'D', 'E', 'I'],
words: ['DIET', 'EDIT', 'TIDE', 'TIED']
-}, {
+}];
+var levels5 = [{
letters: ['T', 'E', 'L', 'A', 'R'],
- words: ['ALTER', 'ALTER', 'LATER']
+ words: ['ALERT', 'ALTER', 'LATER']
}, {
letters: ['E', 'S', 'M', 'L', 'I'],
words: ['LIMES', 'SMILE', 'MILES', 'SLIME']
}, {
A smooth, clean, blank and empty scrabble tile for a game.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A clean, warm and welcoming classroom in a school, facing the blackboard.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A small golden star. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.