User prompt
make the P2 lines hit the second target and not the first one.
User prompt
add another target for p2 to shoot too.
User prompt
make the game to force you to play with 2 players.
User prompt
remove the text “PRESS START 0/1 CREDITS” on gameplay.
User prompt
when added credit. make sure it automatically takes you to the ready screen and not the gameplay.
User prompt
I ment to remove the tap mechanism to skip and change the tap mechanism to add another credit.
User prompt
remove the tap mechanism to on the ready screen you can add another credit when tapped.
User prompt
Please fix the bug: 'Script error.' in or related to this line: 'creditsText.setText(coins + '/' + maxCoins + ' CREDITS');' Line Number: 101
User prompt
remove the hold mechanism and change that hold mechanism to hold to skip. and make sure that the credit is gone when used for player 1.
User prompt
on the ready screen. keep the “INSERT COIN 0/1 CREDITS” there.
User prompt
when there is only 1 player. there can only be 2 cannons. if there is 2 players. then 4 cannons should be there.
User prompt
remove the tap/hold mechanism when it’s on the game play so I can drag the target.
User prompt
why does when I tap To insert a coin. I automatically go into the gameplay? change it so I can hold to skip the countdown on the ready screen
User prompt
when there is 1 credit. P1 doesn’t press start. plus when added credit. Make it take you to the ready screen. and Instead of tapping to skip countdown. you have to hold again so when you tap. you insert another coin.
User prompt
why is there another 2 cannons on the top? they are supposed to be on the bottom next to the P1 cannons.
User prompt
the target isn’t movable. and when moving the target with the persons hand moving. the lines appear.
User prompt
Make the target movable. And while shooting. Lines come from the cannons to the target. and there is supposed to be 4 cannons. not 2. and make it so when you press start. the credit goes away and only 1 player is ready.
User prompt
why is there still 2 ships in a middle. they are supposed to be in each corner? (only on the bottom.)
User prompt
When gameplay starts. And when there is 2 players. There is 2 ships in each corner 1 red for P1 and on the other side and Blue for P2 which is also on each side. and those ships don’t move. and a target appears during gameplay. also in the ready screen where players join you can tap to skip the countdown.
User prompt
When On the Ready Screen. After the 15 countdown. There is 4 ships. Two for P1 and one for P2. Those Ships don’t move. And When there is only 1 player. There is only 2 ships. When on gameplay. A text will pop up saying “Shoot Enemy Ships” and after 2 seconds a text will pop up saying “Ready?” And After 1 Second it will say “Go!” And on the bottom. Two arrows will appear by the Word “Protect Cannons” and the gameplay starts.
User prompt
When you hold. A Ship icon Appears. Another Ship Icon Appears. But Faded. When Inserted a coin and Pressed Start. The Second Ship Will Appear but it’s not faded. And while that happens. A 15 Second Countdown appears. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Make the controls. On the title screen. Tap to insert a coin. Hold to Press Start.
User prompt
after the 2 The “INSERT COIN! 0/1 CREDITS” will appear of the top of the screen. The “0/1 CREDITS” will appear under the “INSERT COIN!”
User prompt
let’s make an animation for the 2. After 3 seconds. The 2 will come up and finish the title.
User prompt
move the 2 By the Invader Blits.
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x000000
});
/****
* Game Code
****/
// Game state variables
var coins = 0;
var maxCoins = 1;
var gameStarted = false;
var insertCoinText;
var creditsText;
var pressStartText;
var holdStartTime = 0;
var isHolding = false;
// Create main title text "Invader Blits"
var titleText = new Text2('Invader Blits', {
size: 120,
fill: 0xFFFFFF
});
titleText.anchor.set(0.5, 0.5);
titleText.x = 2048 / 2;
titleText.y = 2732 / 2 - 50;
game.addChild(titleText);
// Create the "2" text (initially hidden)
var numberText = new Text2('2', {
size: 120,
fill: 0xFFFFFF
});
numberText.anchor.set(0.5, 0.5);
numberText.x = 2048 / 2 + titleText.width / 2 + 20; // Position it after "Invader Blits"
numberText.y = 2732 / 2 - 50;
numberText.alpha = 0; // Start invisible
game.addChild(numberText);
// Position the "2" below the screen initially for slide-up animation
numberText.y = 2732 + 100; // Start below screen
numberText.alpha = 1; // Make it visible but positioned off-screen
// Show the "2" after 3 seconds with a slide-up animation
LK.setTimeout(function () {
tween(numberText, {
y: 2732 / 2 - 50 // Slide up to final position next to title
}, {
duration: 800,
easing: tween.easeOut
});
// After the "2" animation completes, show the INSERT COIN! text
LK.setTimeout(function () {
// Create "INSERT COIN!" text
insertCoinText = new Text2('INSERT COIN!', {
size: 60,
fill: 0xFFFF00 // Yellow color
});
insertCoinText.anchor.set(0.5, 0.5);
insertCoinText.x = 2048 / 2;
insertCoinText.y = 300; // Top of screen
game.addChild(insertCoinText);
// Create "0/1 CREDITS" text
creditsText = new Text2('0/1 CREDITS', {
size: 40,
fill: 0xFFFFFF // White color
});
creditsText.anchor.set(0.5, 0.5);
creditsText.x = 2048 / 2;
creditsText.y = 380; // Below INSERT COIN!
game.addChild(creditsText);
}, 800); // Wait for the "2" animation to complete
}, 3000);
// Function to update credits display
function updateCreditsDisplay() {
creditsText.setText(coins + '/' + maxCoins + ' CREDITS');
// Show "PRESS START" when we have coins
if (coins > 0 && !pressStartText) {
pressStartText = new Text2('PRESS START', {
size: 50,
fill: 0x00FF00 // Green color
});
pressStartText.anchor.set(0.5, 0.5);
pressStartText.x = 2048 / 2;
pressStartText.y = 450; // Below credits
game.addChild(pressStartText);
// Make it blink
tween(pressStartText, {
alpha: 0.3
}, {
duration: 500,
yoyo: true,
repeat: -1
});
}
}
// Touch down event for inserting coins and starting game
game.down = function (x, y, obj) {
if (gameStarted) return;
// Insert coin with tap
if (coins < maxCoins) {
coins++;
updateCreditsDisplay();
// Hide INSERT COIN text when max coins reached
if (coins >= maxCoins && insertCoinText) {
insertCoinText.alpha = 0.3; // Dim it
}
}
// Start holding for PRESS START
if (coins > 0) {
isHolding = true;
holdStartTime = Date.now();
}
};
// Touch up event to stop holding
game.up = function (x, y, obj) {
if (gameStarted) return;
isHolding = false;
// Check if held long enough to start game (1 second)
if (coins > 0 && Date.now() - holdStartTime >= 1000) {
gameStarted = true;
// Hide all title screen elements
if (titleText) titleText.alpha = 0;
if (numberText) numberText.alpha = 0;
if (insertCoinText) insertCoinText.alpha = 0;
if (creditsText) creditsText.alpha = 0;
if (pressStartText) pressStartText.alpha = 0;
// Game would start here - for now just clear screen
game.setBackgroundColor(0x000020); // Dark blue to show game started
}
}; ===================================================================
--- original.js
+++ change.js
@@ -12,8 +12,17 @@
/****
* Game Code
****/
+// Game state variables
+var coins = 0;
+var maxCoins = 1;
+var gameStarted = false;
+var insertCoinText;
+var creditsText;
+var pressStartText;
+var holdStartTime = 0;
+var isHolding = false;
// Create main title text "Invader Blits"
var titleText = new Text2('Invader Blits', {
size: 120,
fill: 0xFFFFFF
@@ -45,18 +54,18 @@
});
// After the "2" animation completes, show the INSERT COIN! text
LK.setTimeout(function () {
// Create "INSERT COIN!" text
- var insertCoinText = new Text2('INSERT COIN!', {
+ insertCoinText = new Text2('INSERT COIN!', {
size: 60,
fill: 0xFFFF00 // Yellow color
});
insertCoinText.anchor.set(0.5, 0.5);
insertCoinText.x = 2048 / 2;
insertCoinText.y = 300; // Top of screen
game.addChild(insertCoinText);
// Create "0/1 CREDITS" text
- var creditsText = new Text2('0/1 CREDITS', {
+ creditsText = new Text2('0/1 CREDITS', {
size: 40,
fill: 0xFFFFFF // White color
});
creditsText.anchor.set(0.5, 0.5);
@@ -64,5 +73,62 @@
creditsText.y = 380; // Below INSERT COIN!
game.addChild(creditsText);
}, 800); // Wait for the "2" animation to complete
}, 3000);
-;
\ No newline at end of file
+// Function to update credits display
+function updateCreditsDisplay() {
+ creditsText.setText(coins + '/' + maxCoins + ' CREDITS');
+ // Show "PRESS START" when we have coins
+ if (coins > 0 && !pressStartText) {
+ pressStartText = new Text2('PRESS START', {
+ size: 50,
+ fill: 0x00FF00 // Green color
+ });
+ pressStartText.anchor.set(0.5, 0.5);
+ pressStartText.x = 2048 / 2;
+ pressStartText.y = 450; // Below credits
+ game.addChild(pressStartText);
+ // Make it blink
+ tween(pressStartText, {
+ alpha: 0.3
+ }, {
+ duration: 500,
+ yoyo: true,
+ repeat: -1
+ });
+ }
+}
+// Touch down event for inserting coins and starting game
+game.down = function (x, y, obj) {
+ if (gameStarted) return;
+ // Insert coin with tap
+ if (coins < maxCoins) {
+ coins++;
+ updateCreditsDisplay();
+ // Hide INSERT COIN text when max coins reached
+ if (coins >= maxCoins && insertCoinText) {
+ insertCoinText.alpha = 0.3; // Dim it
+ }
+ }
+ // Start holding for PRESS START
+ if (coins > 0) {
+ isHolding = true;
+ holdStartTime = Date.now();
+ }
+};
+// Touch up event to stop holding
+game.up = function (x, y, obj) {
+ if (gameStarted) return;
+ isHolding = false;
+ // Check if held long enough to start game (1 second)
+ if (coins > 0 && Date.now() - holdStartTime >= 1000) {
+ gameStarted = true;
+ // Hide all title screen elements
+ if (titleText) titleText.alpha = 0;
+ if (numberText) numberText.alpha = 0;
+ if (insertCoinText) insertCoinText.alpha = 0;
+ if (creditsText) creditsText.alpha = 0;
+ if (pressStartText) pressStartText.alpha = 0;
+ // Game would start here - for now just clear screen
+ game.setBackgroundColor(0x000020); // Dark blue to show game started
+ }
+};
\ No newline at end of file