User prompt
Fix Bug: 'Uncaught ReferenceError: createMenuPage is not defined' in or related to this line: 'createMenuPage(self, 'Easy', 'easy', '#00ff00');' Line Number: 159
Code edit (1 edits merged)
Please save this source code
User prompt
make text (on main menu page) saying: "easy" a button and when pressed on, it takes user to easy page
User prompt
make text (on main menu page) saying: "easy" a button and make it lead to easy page
User prompt
make "easy" button (on main menu page) lead to easy page
User prompt
make buttons darker when they are pressed on
User prompt
make "easy" button lead to "easy" page
User prompt
move the "easy" button up
User prompt
move the "hard" button down
User prompt
move the "hard" button down
User prompt
move the "hard" button up
User prompt
move the "easy" button up
User prompt
move the "easy" button up
User prompt
move the "easy" button up
User prompt
make the "easy" button (on main menu page) lead to "easy" page. make the "medium" button (on main menu page) lead to "medium" page. make the "hard" button (on main menu page) lead to "hard" page.
User prompt
why are "easy" and "hard" not buttons
User prompt
change the title name to say: "Blast through the Cosmos"
User prompt
make the colour of the title not black
User prompt
make the title look more catchy
User prompt
make the title be at the x-axis of 0
User prompt
make the title say "Blast through the Cosmos"
User prompt
add title to the top center of main menu page
User prompt
add title at the top of menu pager
User prompt
remove title on menu page
User prompt
remove the title on the home page
===================================================================
--- original.js
+++ change.js
@@ -151,40 +151,16 @@
});
});
var EasyMenuPage = Container.expand(function () {
var self = Container.call(this);
- var titleTxt = new Text2('Space Saga', {
- size: 150,
- fill: "#ffffff"
- });
- titleTxt.anchor.set(0.5, 0);
- titleTxt.x = game.width / 2;
- titleTxt.y = 100;
- self.addChild(titleTxt);
createMenuPage(self, 'Easy', 'easy', '#00ff00');
});
var MediumMenuPage = Container.expand(function () {
var self = Container.call(this);
- var titleTxt = new Text2('Space Saga', {
- size: 150,
- fill: "#ffffff"
- });
- titleTxt.anchor.set(0.5, 0);
- titleTxt.x = game.width / 2;
- titleTxt.y = 100;
- self.addChild(titleTxt);
createMenuPage(self, 'Medium', 'medium', '#ffff00');
});
var HardMenuPage = Container.expand(function () {
var self = Container.call(this);
- var titleTxt = new Text2('Space Saga', {
- size: 150,
- fill: "#ffffff"
- });
- titleTxt.anchor.set(0.5, 0);
- titleTxt.x = game.width / 2;
- titleTxt.y = 100;
- self.addChild(titleTxt);
createMenuPage(self, 'Hard', 'hard', '#ff0000');
});
/****
@@ -198,8 +174,9 @@
/****
* Game Code
****/
+// Initialize the MenuPage
/****function initializeGame(selectedDifficulty) {
difficulty = selectedDifficulty;
// Initialize important asset arrays
var heroBullets = [];
@@ -351,9 +328,8 @@
});
}
* Assets
****/
-// Initialize the MenuPage
function createMenuPage(menuPage, difficultyText, difficulty, buttonColor) {
var difficultyButton = new Button(difficultyText, game.width / 2, game.height / 2 + 100, function () {
menuPage.destroy();
initializeGame(difficulty);
@@ -513,5 +489,14 @@
var easyMenuPage = game.addChild(new EasyMenuPage());
easyMenuPage.y -= 400;
var mediumMenuPage = game.addChild(new MediumMenuPage());
var hardMenuPage = game.addChild(new HardMenuPage());
-hardMenuPage.y += 400;
\ No newline at end of file
+hardMenuPage.y += 400;
+// Add title to the top center of the main menu page
+var menuTitle = new Text2('Space Saga Odyssey', {
+ size: 100,
+ fill: "#ffffff"
+});
+menuTitle.anchor.set(0.5, 0);
+menuTitle.x = game.width / 2;
+menuTitle.y = 50;
+LK.gui.top.addChild(menuTitle);
\ No newline at end of file
android. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
letter X png. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
space background. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
galaxy background. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
galaxy background. High quality
space background.. High contrast