User prompt
Generate the 30th version of the source code of my game: SCP-3301
User prompt
Generate the 29th version of the source code of my game: SCP-3301
User prompt
Generate more of the source code of my game: SCP-3301
User prompt
Generate the 28th version of the source code of my game: SCP-3301
User prompt
Generate the 27th version of the source code of my game: SCP-3301
User prompt
Generate the 26th version of the source code of my game: SCP-3301
User prompt
Generate the 25th version of the source code of my game: SCP-3301
User prompt
Generate the 24th version of the source code of my game: SCP-3301
User prompt
Generate the 23th version of the source code of my game: SCP-3301
User prompt
Generate the 22th version of the source code of my game: SCP-3301
User prompt
Generate the 21th version of the source code of my game: SCP-3301
User prompt
Please fix the bug: 'Can't find variable: moneyCounter' in or related to this line: 'if (playerPiece.lastWasIntersectingMoney !== true && playerPiece.intersects(moneyCounter)) {' Line Number: 147
User prompt
Generate the first version of the source code of my game: SCP-3301
User prompt
Generate the 20th version of the source code of my game: SCP-3301
User prompt
Generate the 19th version of the source code of my game: SCP-3301
User prompt
Generate the 18th version of the source code of my game: SCP-3301
User prompt
Generate the 17th version of the source code of my game: SCP-3301
User prompt
Generate the 17 version of the source code of my game: SCP-3301
User prompt
Generate the 16th version of the source code of my game: SCP-3301
User prompt
Generate the 15th version of the source code of my game: SCP-3301
User prompt
Generate the 14th version of the source code of my game: SCP-3301
User prompt
Generate the 13th version of the source code of my game: SCP-3301
User prompt
Generate the 12th version of the source code of my game: SCP-3301
User prompt
Generate the 11th version of the source code of my game: SCP-3301
User prompt
Generate the 10th version of the source code of my game: SCP-3301
/**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x000000 }); /**** * Game Code ****/ // Board setup // --- SCP-3301: Initial Board, Player, and Card Draw Logic --- var board = LK.getAsset('board', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: 2732 / 2 }); game.addChild(board); // Player piece setup var playerPiece = LK.getAsset('player', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: 2732 - 300 }); playerPiece.lastX = playerPiece.x; playerPiece.lastY = playerPiece.y; game.addChild(playerPiece); // HP bar setup above player piece var hpBarBg = LK.getAsset('healthBar', { anchorX: 0.5, anchorY: 0.5, x: playerPiece.x, y: playerPiece.y - 80 }); game.addChild(hpBarBg); var hpBar = LK.getAsset('HealthPercent', { anchorX: 0, anchorY: 0.5, x: playerPiece.x - 30, y: playerPiece.y - 80, width: 60, height: 10 }); game.addChild(hpBar); // Function to update HP bar function updateHPBar() { // Defensive: check playerStats exists and has HP property var hp = 10; if (typeof playerStats !== 'undefined' && typeof playerStats.HP === 'number') { hp = playerStats.HP; } var percent = Math.max(0, Math.min(1, hp / 10)); hpBar.width = 60 * percent; } updateHPBar(); // Dice roll and movement logic var diceResult = 0; var diceText = new Text2('Roll: -', { size: 80, fill: 0xffffff }); diceText.anchor.set(0.5, 0.5); diceText.x = 2048 / 2; diceText.y = 2732 - 220; LK.gui.bottom.addChild(diceText); var canMove = false; var moveRadius = 0; // Roll dice button var rollBtn = LK.getAsset('button', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2 - 200, y: 2732 - 120 }); game.addChild(rollBtn); var rollBtnText = new Text2('Roll Dice', { size: 48, fill: 0x000000 }); rollBtnText.anchor.set(0.5, 0.5); rollBtnText.x = rollBtn.x; rollBtnText.y = rollBtn.y; LK.gui.bottom.addChild(rollBtnText); rollBtn.down = function (x, y, obj) { // Roll two six-sided dice var d1 = Math.floor(Math.random() * 6) + 1; var d2 = Math.floor(Math.random() * 6) + 1; diceResult = d1 + d2; diceText.setText('Roll: ' + diceResult); moveRadius = diceResult * 40; // 40px per dice point, adjust as needed canMove = true; }; // Drag/move logic for player piece var dragging = false; playerPiece.down = function (x, y, obj) { if (canMove) { dragging = true; } }; game.move = function (x, y, obj) { if (dragging && canMove) { // Track lastX and lastY before moving playerPiece.lastX = playerPiece.x; playerPiece.lastY = playerPiece.y; // Calculate distance from original position var dx = x - playerPiece.x; var dy = y - playerPiece.y; var dist = Math.sqrt(dx * dx + dy * dy); if (dist <= moveRadius) { playerPiece.x = x; playerPiece.y = y; } else { // Clamp to moveRadius var angle = Math.atan2(dy, dx); playerPiece.x = playerPiece.x + Math.cos(angle) * moveRadius; playerPiece.y = playerPiece.y + Math.sin(angle) * moveRadius; } // Update HP bar position to follow player hpBarBg.x = playerPiece.x; hpBarBg.y = playerPiece.y - 80; hpBar.x = playerPiece.x - 30; hpBar.y = playerPiece.y - 80; // Event: trigger when playerPiece crosses center X (2048/2 = 1024) if (playerPiece.lastX <= 1024 && playerPiece.x > 1024) { // Example: flash screen green for 500ms LK.effects.flashScreen(0x00ff00, 500); } // Event: trigger when playerPiece crosses left half of the board (x=1024 to x<1024) if (playerPiece.lastX >= 1024 && playerPiece.x < 1024) { // Example: flash screen red for 500ms LK.effects.flashScreen(0xff0000, 500); } // Event: trigger when playerPiece crosses from right to left half of the board (x=1024 to x<1024) (repeat event for version 21) if (playerPiece.lastX > 1024 && playerPiece.x <= 1024) { // Example: flash screen violet for 500ms LK.effects.flashScreen(0xee82ee, 500); } // Event: trigger when playerPiece crosses from right to left half of the board (x=1024 to x<1024) if (playerPiece.lastX > 1024 && playerPiece.x <= 1024) { // Example: flash screen orange for 500ms LK.effects.flashScreen(0xffa500, 500); } // Event: trigger when playerPiece crosses from left to right half of the board (x=1024 to x>1024) if (playerPiece.lastX < 1024 && playerPiece.x >= 1024) { // Example: flash screen blue for 500ms LK.effects.flashScreen(0x0000ff, 500); } // Event: trigger when playerPiece crosses center Y (2732/2 = 1366) if (playerPiece.lastY <= 1366 && playerPiece.y > 1366) { // Example: flash screen pink for 500ms LK.effects.flashScreen(0xff69b4, 500); } // Event: trigger when playerPiece crosses from top to bottom half of the board (y=1366 to y>1366) if (playerPiece.lastY < 1366 && playerPiece.y >= 1366) { // Example: flash screen green for 500ms LK.effects.flashScreen(0x00ff00, 500); } // Event: trigger when playerPiece crosses from top to bottom half of the board (y=1366 to y>1366) (repeat event for version 20) if (playerPiece.lastY <= 1366 && playerPiece.y > 1366) { // Example: flash screen teal for 500ms LK.effects.flashScreen(0x008080, 500); } // Event: trigger when playerPiece crosses from bottom to top half of the board (y=1366 to y<1366) if (playerPiece.lastY >= 1366 && playerPiece.y < 1366) { // Example: flash screen light blue for 500ms LK.effects.flashScreen(0x87cefa, 500); } // Event: trigger when playerPiece crosses the center X coordinate (x=1024) if (playerPiece.lastX <= 1024 && playerPiece.x > 1024) { // Example: flash screen lime for 500ms LK.effects.flashScreen(0x32cd32, 500); } } // Event: trigger when playerPiece crosses Y=600 if (playerPiece.lastY <= 600 && playerPiece.y > 600) { // Example: flash screen blue for 500ms LK.effects.flashScreen(0x0000ff, 500); } // Event: trigger when playerPiece arrives at X=1500, Y=800 if (playerPiece.lastY <= 800 && playerPiece.y > 800 && playerPiece.lastX <= 1500 && playerPiece.x > 1500) { // Example: flash screen yellow for 500ms LK.effects.flashScreen(0xffff00, 500); } // Event: trigger when playerPiece intersects with moneyCounter (exact collision moment) if (playerPiece.lastWasIntersectingMoney !== true && playerPiece.intersects(moneyCounter)) { // Example: flash screen magenta for 500ms LK.effects.flashScreen(0xff00ff, 500); } // Event: trigger when playerPiece crosses the right edge of the board (x=2048) if (playerPiece.lastX <= 2048 && playerPiece.x > 2048) { // Example: flash screen cyan for 500ms LK.effects.flashScreen(0x00ffff, 500); } // Event: trigger when playerPiece crosses the left edge of the board (x=0) if (playerPiece.lastX >= 0 && playerPiece.x < 0) { // Example: flash screen orange for 500ms LK.effects.flashScreen(0xffa500, 500); } // Event: trigger when playerPiece crosses the top edge of the board (y=0) if (playerPiece.lastY >= 0 && playerPiece.y < 0) { // Example: flash screen purple for 500ms LK.effects.flashScreen(0x800080, 500); } // Event: trigger when playerPiece crosses the bottom edge of the board (y=2732) if (playerPiece.lastY <= 2732 && playerPiece.y > 2732) { // Example: flash screen teal for 500ms LK.effects.flashScreen(0x008080, 500); } // Always update lastX and lastY for playerPiece for event triggers playerPiece.lastX = playerPiece.x; playerPiece.lastY = playerPiece.y; // Track last intersection state for moneyCounter playerPiece.lastWasIntersectingMoney = playerPiece.intersects(moneyCounter); }; game.up = function (x, y, obj) { if (dragging) { dragging = false; canMove = false; moveRadius = 0; diceText.setText('Roll: -'); } }; // Card hand setup var hand = []; var maxHandSize = 10; var initialHandSize = 7; // Card draw function function drawCard() { // For now, just use a generic card back as a placeholder var card = LK.getAsset('cardBack', { anchorX: 0.5, anchorY: 0.5 }); hand.push(card); return card; } // Draw initial hand for (var i = 0; i < initialHandSize; i++) { var card = drawCard(); // Display cards in a fan at the bottom of the screen card.x = 2048 / 2 - (initialHandSize - 1) * 60 / 2 + i * 60; card.y = 2732 - 120; game.addChild(card); } // End turn button var endTurnBtn = LK.getAsset('EndTurnButton', { anchorX: 0.5, anchorY: 0.5, x: 2048 - 200, y: 2732 - 120 }); game.addChild(endTurnBtn); // Draw card at end of turn, discard if over max hand size endTurnBtn.down = function (x, y, obj) { if (hand.length < maxHandSize) { var card = drawCard(); card.x = 2048 / 2 - (initialHandSize - 1) * 60 / 2 + (hand.length - 1) * 60; card.y = 2732 - 120; game.addChild(card); } // After drawing, check if hand exceeds max size and discard if needed while (hand.length > maxHandSize) { var discarded = hand.pop(); discarded.destroy(); } // After discarding, update card positions in hand for (var i = 0; i < hand.length; i++) { hand[i].x = 2048 / 2 - (hand.length - 1) * 60 / 2 + i * 60; hand[i].y = 2732 - 120; } }; // Money counter (yellow cards effect) var moneyCounter = LK.getAsset('moneyCounterDisplay', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: 80 }); game.addChild(moneyCounter); var moneyValue = 10000; var moneyText = new Text2('$' + moneyValue, { size: 80, fill: 0xFFFF00 }); moneyText.anchor.set(0.5, 0.5); moneyText.x = 2048 / 2; moneyText.y = 80; LK.gui.top.addChild(moneyText); // Update money display function function updateMoney(val) { moneyValue = val; moneyText.setText('$' + moneyValue); } // --- Player Stats Display and Initialization --- var playerStats = { ATK: 6, DEF: 6, HP: 10, SPD: 8, ACC: 8 }; var statsText = new Text2('ATK: ' + playerStats.ATK + ' DEF: ' + playerStats.DEF + ' HP: ' + playerStats.HP + ' SPD: ' + playerStats.SPD + ' ACC: ' + playerStats.ACC, { size: 60, fill: 0xFFFFFF }); statsText.anchor.set(0.5, 0); statsText.x = 2048 / 2; statsText.y = 180; LK.gui.top.addChild(statsText); // Function to update stats display function updateStatsDisplay() { statsText.setText('ATK: ' + playerStats.ATK + ' DEF: ' + playerStats.DEF + ' HP: ' + playerStats.HP + ' SPD: ' + playerStats.SPD + ' ACC: ' + playerStats.ACC); } // Placeholder for future: draw card types, entity spawn, and win conditions // --- End SCP-3301 initial setup ---
===================================================================
--- original.js
+++ change.js
@@ -7,10 +7,10 @@
/****
* Game Code
****/
-// --- SCP-3301: Initial Board, Player, and Card Draw Logic ---
// Board setup
+// --- SCP-3301: Initial Board, Player, and Card Draw Logic ---
var board = LK.getAsset('board', {
anchorX: 0.5,
anchorY: 0.5,
x: 2048 / 2,
@@ -26,98 +26,203 @@
});
playerPiece.lastX = playerPiece.x;
playerPiece.lastY = playerPiece.y;
game.addChild(playerPiece);
-// Event: trigger when playerPiece crosses center X (2048/2 = 1024)
-if (playerPiece.lastX <= 1024 && playerPiece.x > 1024) {
- // Example: flash screen green for 500ms
- LK.effects.flashScreen(0x00ff00, 500);
- if (playerPiece.lastX >= 1024 && playerPiece.x < 1024) {
- // Example: flash screen red for 500ms
- LK.effects.flashScreen(0xff0000, 500);
+// HP bar setup above player piece
+var hpBarBg = LK.getAsset('healthBar', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: playerPiece.x,
+ y: playerPiece.y - 80
+});
+game.addChild(hpBarBg);
+var hpBar = LK.getAsset('HealthPercent', {
+ anchorX: 0,
+ anchorY: 0.5,
+ x: playerPiece.x - 30,
+ y: playerPiece.y - 80,
+ width: 60,
+ height: 10
+});
+game.addChild(hpBar);
+// Function to update HP bar
+function updateHPBar() {
+ // Defensive: check playerStats exists and has HP property
+ var hp = 10;
+ if (typeof playerStats !== 'undefined' && typeof playerStats.HP === 'number') {
+ hp = playerStats.HP;
}
- // Event: trigger when playerPiece crosses from right to left half of the board (x=1024 to x<1024)
- if (playerPiece.lastX > 1024 && playerPiece.x <= 1024) {
- // Example: flash screen orange for 500ms
- LK.effects.flashScreen(0xffa500, 500);
+ var percent = Math.max(0, Math.min(1, hp / 10));
+ hpBar.width = 60 * percent;
+}
+updateHPBar();
+// Dice roll and movement logic
+var diceResult = 0;
+var diceText = new Text2('Roll: -', {
+ size: 80,
+ fill: 0xffffff
+});
+diceText.anchor.set(0.5, 0.5);
+diceText.x = 2048 / 2;
+diceText.y = 2732 - 220;
+LK.gui.bottom.addChild(diceText);
+var canMove = false;
+var moveRadius = 0;
+// Roll dice button
+var rollBtn = LK.getAsset('button', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 2048 / 2 - 200,
+ y: 2732 - 120
+});
+game.addChild(rollBtn);
+var rollBtnText = new Text2('Roll Dice', {
+ size: 48,
+ fill: 0x000000
+});
+rollBtnText.anchor.set(0.5, 0.5);
+rollBtnText.x = rollBtn.x;
+rollBtnText.y = rollBtn.y;
+LK.gui.bottom.addChild(rollBtnText);
+rollBtn.down = function (x, y, obj) {
+ // Roll two six-sided dice
+ var d1 = Math.floor(Math.random() * 6) + 1;
+ var d2 = Math.floor(Math.random() * 6) + 1;
+ diceResult = d1 + d2;
+ diceText.setText('Roll: ' + diceResult);
+ moveRadius = diceResult * 40; // 40px per dice point, adjust as needed
+ canMove = true;
+};
+// Drag/move logic for player piece
+var dragging = false;
+playerPiece.down = function (x, y, obj) {
+ if (canMove) {
+ dragging = true;
}
- // Event: trigger when playerPiece crosses from left to right half of the board (x=1024 to x>1024)
- if (playerPiece.lastX < 1024 && playerPiece.x >= 1024) {
+};
+game.move = function (x, y, obj) {
+ if (dragging && canMove) {
+ // Track lastX and lastY before moving
+ playerPiece.lastX = playerPiece.x;
+ playerPiece.lastY = playerPiece.y;
+ // Calculate distance from original position
+ var dx = x - playerPiece.x;
+ var dy = y - playerPiece.y;
+ var dist = Math.sqrt(dx * dx + dy * dy);
+ if (dist <= moveRadius) {
+ playerPiece.x = x;
+ playerPiece.y = y;
+ } else {
+ // Clamp to moveRadius
+ var angle = Math.atan2(dy, dx);
+ playerPiece.x = playerPiece.x + Math.cos(angle) * moveRadius;
+ playerPiece.y = playerPiece.y + Math.sin(angle) * moveRadius;
+ }
+ // Update HP bar position to follow player
+ hpBarBg.x = playerPiece.x;
+ hpBarBg.y = playerPiece.y - 80;
+ hpBar.x = playerPiece.x - 30;
+ hpBar.y = playerPiece.y - 80;
+ // Event: trigger when playerPiece crosses center X (2048/2 = 1024)
+ if (playerPiece.lastX <= 1024 && playerPiece.x > 1024) {
+ // Example: flash screen green for 500ms
+ LK.effects.flashScreen(0x00ff00, 500);
+ }
+ // Event: trigger when playerPiece crosses left half of the board (x=1024 to x<1024)
+ if (playerPiece.lastX >= 1024 && playerPiece.x < 1024) {
+ // Example: flash screen red for 500ms
+ LK.effects.flashScreen(0xff0000, 500);
+ }
+ // Event: trigger when playerPiece crosses from right to left half of the board (x=1024 to x<1024) (repeat event for version 21)
+ if (playerPiece.lastX > 1024 && playerPiece.x <= 1024) {
+ // Example: flash screen violet for 500ms
+ LK.effects.flashScreen(0xee82ee, 500);
+ }
+ // Event: trigger when playerPiece crosses from right to left half of the board (x=1024 to x<1024)
+ if (playerPiece.lastX > 1024 && playerPiece.x <= 1024) {
+ // Example: flash screen orange for 500ms
+ LK.effects.flashScreen(0xffa500, 500);
+ }
+ // Event: trigger when playerPiece crosses from left to right half of the board (x=1024 to x>1024)
+ if (playerPiece.lastX < 1024 && playerPiece.x >= 1024) {
+ // Example: flash screen blue for 500ms
+ LK.effects.flashScreen(0x0000ff, 500);
+ }
+ // Event: trigger when playerPiece crosses center Y (2732/2 = 1366)
+ if (playerPiece.lastY <= 1366 && playerPiece.y > 1366) {
+ // Example: flash screen pink for 500ms
+ LK.effects.flashScreen(0xff69b4, 500);
+ }
+ // Event: trigger when playerPiece crosses from top to bottom half of the board (y=1366 to y>1366)
+ if (playerPiece.lastY < 1366 && playerPiece.y >= 1366) {
+ // Example: flash screen green for 500ms
+ LK.effects.flashScreen(0x00ff00, 500);
+ }
+ // Event: trigger when playerPiece crosses from top to bottom half of the board (y=1366 to y>1366) (repeat event for version 20)
+ if (playerPiece.lastY <= 1366 && playerPiece.y > 1366) {
+ // Example: flash screen teal for 500ms
+ LK.effects.flashScreen(0x008080, 500);
+ }
+ // Event: trigger when playerPiece crosses from bottom to top half of the board (y=1366 to y<1366)
+ if (playerPiece.lastY >= 1366 && playerPiece.y < 1366) {
+ // Example: flash screen light blue for 500ms
+ LK.effects.flashScreen(0x87cefa, 500);
+ }
+ // Event: trigger when playerPiece crosses the center X coordinate (x=1024)
+ if (playerPiece.lastX <= 1024 && playerPiece.x > 1024) {
+ // Example: flash screen lime for 500ms
+ LK.effects.flashScreen(0x32cd32, 500);
+ }
+ }
+ // Event: trigger when playerPiece crosses Y=600
+ if (playerPiece.lastY <= 600 && playerPiece.y > 600) {
// Example: flash screen blue for 500ms
LK.effects.flashScreen(0x0000ff, 500);
}
- // Event: trigger when playerPiece crosses center Y (2732/2 = 1366)
- if (playerPiece.lastY <= 1366 && playerPiece.y > 1366) {
- // Example: flash screen pink for 500ms
- LK.effects.flashScreen(0xff69b4, 500);
+ // Event: trigger when playerPiece arrives at X=1500, Y=800
+ if (playerPiece.lastY <= 800 && playerPiece.y > 800 && playerPiece.lastX <= 1500 && playerPiece.x > 1500) {
+ // Example: flash screen yellow for 500ms
+ LK.effects.flashScreen(0xffff00, 500);
}
- // Event: trigger when playerPiece crosses from top to bottom half of the board (y=1366 to y>1366)
- if (playerPiece.lastY < 1366 && playerPiece.y >= 1366) {
- // Example: flash screen green for 500ms
- LK.effects.flashScreen(0x00ff00, 500);
+ // Event: trigger when playerPiece intersects with moneyCounter (exact collision moment)
+ if (playerPiece.lastWasIntersectingMoney !== true && playerPiece.intersects(moneyCounter)) {
+ // Example: flash screen magenta for 500ms
+ LK.effects.flashScreen(0xff00ff, 500);
}
- // Event: trigger when playerPiece crosses from top to bottom half of the board (y=1366 to y>1366) (repeat event for version 20)
- if (playerPiece.lastY <= 1366 && playerPiece.y > 1366) {
+ // Event: trigger when playerPiece crosses the right edge of the board (x=2048)
+ if (playerPiece.lastX <= 2048 && playerPiece.x > 2048) {
+ // Example: flash screen cyan for 500ms
+ LK.effects.flashScreen(0x00ffff, 500);
+ }
+ // Event: trigger when playerPiece crosses the left edge of the board (x=0)
+ if (playerPiece.lastX >= 0 && playerPiece.x < 0) {
+ // Example: flash screen orange for 500ms
+ LK.effects.flashScreen(0xffa500, 500);
+ }
+ // Event: trigger when playerPiece crosses the top edge of the board (y=0)
+ if (playerPiece.lastY >= 0 && playerPiece.y < 0) {
+ // Example: flash screen purple for 500ms
+ LK.effects.flashScreen(0x800080, 500);
+ }
+ // Event: trigger when playerPiece crosses the bottom edge of the board (y=2732)
+ if (playerPiece.lastY <= 2732 && playerPiece.y > 2732) {
// Example: flash screen teal for 500ms
LK.effects.flashScreen(0x008080, 500);
}
- // Event: trigger when playerPiece crosses from bottom to top half of the board (y=1366 to y<1366)
- if (playerPiece.lastY >= 1366 && playerPiece.y < 1366) {
- // Example: flash screen light blue for 500ms
- LK.effects.flashScreen(0x87cefa, 500);
+ // Always update lastX and lastY for playerPiece for event triggers
+ playerPiece.lastX = playerPiece.x;
+ playerPiece.lastY = playerPiece.y;
+ // Track last intersection state for moneyCounter
+ playerPiece.lastWasIntersectingMoney = playerPiece.intersects(moneyCounter);
+};
+game.up = function (x, y, obj) {
+ if (dragging) {
+ dragging = false;
+ canMove = false;
+ moveRadius = 0;
+ diceText.setText('Roll: -');
}
- // Event: trigger when playerPiece crosses the center X coordinate (x=1024)
- if (playerPiece.lastX <= 1024 && playerPiece.x > 1024) {
- // Example: flash screen lime for 500ms
- LK.effects.flashScreen(0x32cd32, 500);
- }
-}
-// Event: trigger when playerPiece crosses Y=600
-if (playerPiece.lastY <= 600 && playerPiece.y > 600) {
- // Example: flash screen blue for 500ms
- LK.effects.flashScreen(0x0000ff, 500);
-}
-// Event: trigger when playerPiece arrives at X=1500, Y=800
-if (playerPiece.lastY <= 800 && playerPiece.y > 800 && playerPiece.lastX <= 1500 && playerPiece.x > 1500) {
- // Example: flash screen yellow for 500ms
- LK.effects.flashScreen(0xffff00, 500);
-}
-// Money counter setup
-var moneyCounter = LK.getAsset('moneyCounterDisplay', {
- anchorX: 0.5,
- anchorY: 0.5,
- x: 2048 - 200,
- y: 200
-});
-game.addChild(moneyCounter);
-// Event: trigger when playerPiece intersects with moneyCounter (exact collision moment)
-if (playerPiece.lastWasIntersectingMoney !== true && playerPiece.intersects(moneyCounter)) {
- // Example: flash screen magenta for 500ms
- LK.effects.flashScreen(0xff00ff, 500);
-}
-// Event: trigger when playerPiece crosses the right edge of the board (x=2048)
-if (playerPiece.lastX <= 2048 && playerPiece.x > 2048) {
- // Example: flash screen cyan for 500ms
- LK.effects.flashScreen(0x00ffff, 500);
-}
-// Event: trigger when playerPiece crosses the left edge of the board (x=0)
-if (playerPiece.lastX >= 0 && playerPiece.x < 0) {
- // Example: flash screen orange for 500ms
- LK.effects.flashScreen(0xffa500, 500);
-}
-// Event: trigger when playerPiece crosses the top edge of the board (y=0)
-if (playerPiece.lastY >= 0 && playerPiece.y < 0) {
- // Example: flash screen purple for 500ms
- LK.effects.flashScreen(0x800080, 500);
-}
-// Event: trigger when playerPiece crosses the bottom edge of the board (y=2732)
-if (playerPiece.lastY <= 2732 && playerPiece.y > 2732) {
- // Example: flash screen teal for 500ms
- LK.effects.flashScreen(0x008080, 500);
-}
-// Always update lastX and lastY for playerPiece for event triggers
-// Track last intersection state for moneyCounter
-playerPiece.lastWasIntersectingMoney = playerPiece.intersects(moneyCounter);
+};
// Card hand setup
var hand = [];
var maxHandSize = 10;
var initialHandSize = 7;
@@ -137,5 +242,76 @@
// Display cards in a fan at the bottom of the screen
card.x = 2048 / 2 - (initialHandSize - 1) * 60 / 2 + i * 60;
card.y = 2732 - 120;
game.addChild(card);
-}
\ No newline at end of file
+}
+// End turn button
+var endTurnBtn = LK.getAsset('EndTurnButton', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 2048 - 200,
+ y: 2732 - 120
+});
+game.addChild(endTurnBtn);
+// Draw card at end of turn, discard if over max hand size
+endTurnBtn.down = function (x, y, obj) {
+ if (hand.length < maxHandSize) {
+ var card = drawCard();
+ card.x = 2048 / 2 - (initialHandSize - 1) * 60 / 2 + (hand.length - 1) * 60;
+ card.y = 2732 - 120;
+ game.addChild(card);
+ }
+ // After drawing, check if hand exceeds max size and discard if needed
+ while (hand.length > maxHandSize) {
+ var discarded = hand.pop();
+ discarded.destroy();
+ }
+ // After discarding, update card positions in hand
+ for (var i = 0; i < hand.length; i++) {
+ hand[i].x = 2048 / 2 - (hand.length - 1) * 60 / 2 + i * 60;
+ hand[i].y = 2732 - 120;
+ }
+};
+// Money counter (yellow cards effect)
+var moneyCounter = LK.getAsset('moneyCounterDisplay', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 2048 / 2,
+ y: 80
+});
+game.addChild(moneyCounter);
+var moneyValue = 10000;
+var moneyText = new Text2('$' + moneyValue, {
+ size: 80,
+ fill: 0xFFFF00
+});
+moneyText.anchor.set(0.5, 0.5);
+moneyText.x = 2048 / 2;
+moneyText.y = 80;
+LK.gui.top.addChild(moneyText);
+// Update money display function
+function updateMoney(val) {
+ moneyValue = val;
+ moneyText.setText('$' + moneyValue);
+}
+// --- Player Stats Display and Initialization ---
+var playerStats = {
+ ATK: 6,
+ DEF: 6,
+ HP: 10,
+ SPD: 8,
+ ACC: 8
+};
+var statsText = new Text2('ATK: ' + playerStats.ATK + ' DEF: ' + playerStats.DEF + ' HP: ' + playerStats.HP + ' SPD: ' + playerStats.SPD + ' ACC: ' + playerStats.ACC, {
+ size: 60,
+ fill: 0xFFFFFF
+});
+statsText.anchor.set(0.5, 0);
+statsText.x = 2048 / 2;
+statsText.y = 180;
+LK.gui.top.addChild(statsText);
+// Function to update stats display
+function updateStatsDisplay() {
+ statsText.setText('ATK: ' + playerStats.ATK + ' DEF: ' + playerStats.DEF + ' HP: ' + playerStats.HP + ' SPD: ' + playerStats.SPD + ' ACC: ' + playerStats.ACC);
+}
+// Placeholder for future: draw card types, entity spawn, and win conditions
+// --- End SCP-3301 initial setup ---
\ No newline at end of file
Healthbar. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
Player. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
Opponent. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
EnergyBar. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
Board. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
Anomaly. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
Button. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
animal. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
SCP. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
SCP card. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
anomalyneutralizer card. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
containmentfield card. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
cardFront. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
barBackground. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
darknessbetweendimensions. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
manual. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
moneyCounterDisplay. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
Wondertainment product. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
EndTurnButton. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
randomscp. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
Attack. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
Containment. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
White Card called “Panacea” which was used to heal. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
modified Colt AR-15. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
giant flaming angel's sword. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
hidden golden anomaly. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
Orangutan. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows