User prompt
it's not this group, it's the group player_1, player_2, etc.
User prompt
change the player's asset group to: player_1, player_2, player_3, and player_4.
User prompt
Caracter animation is player_1, player_2, player_3, player_4
User prompt
Please fix the bug: 'Uncaught ReferenceError: currentAssetIndex is not defined' in or related to this line: 'currentAssetIndex = (currentAssetIndex + 1) % playerAssets.length;' Line Number: 89
User prompt
Please fix the bug: 'Uncaught ReferenceError: playerAssets is not defined' in or related to this line: 'currentAssetIndex = (currentAssetIndex + 1) % playerAssets.length;' Line Number: 91
User prompt
Add sprite frame rate
User prompt
Remove the previous animation, and if it's his turn, it appears again. It's just one sprite at a time
User prompt
animation happens once per click
User prompt
It's not one asset at a time, it's an animation itself
User prompt
Please fix the bug: 'Uncaught TypeError: setTimeout is not a function' in or related to this line: 'setTimeout(function () {' Line Number: 105
User prompt
add hp to wood
User prompt
place on top of the wood
Code edit (9 edits merged)
Please save this source code
User prompt
Add the hp wood variable
User prompt
Make visible
User prompt
Place the variable
User prompt
Add a new variable
User prompt
Add variável to "0" in top of screen
User prompt
Add hp wood to 100
User prompt
Add global variável hp wood to 100, and place it below the score.
User prompt
initial damage to player:10 dmg
User prompt
when the animation ends, the player deals 10 damage to the wood
User prompt
When it reaches HP, the wood is destroyed, and a new wood appears with 100 HP
User prompt
add a destruction effect to wood with pieces of wood coming out of it
User prompt
also add another global variable of coins, and place it below the hp of the wood
===================================================================
--- original.js
+++ change.js
@@ -30,9 +30,9 @@
/****
* Game Code
****/
// Initialize the wooden block image
-var woodHp = 100; // Initialize the HP of the wooden block
+var hpWood = 100; // Initialize the HP of the wooden block
var bg = LK.getAsset('Bg', {
anchorX: 0.0,
anchorY: 0.0,
scaleX: 2048 / 100,
@@ -96,8 +96,15 @@
fill: 0xFFFFFF
});
scoreText.anchor.set(0.5, 0);
LK.gui.top.addChild(scoreText);
+var hpWoodText = new Text2(hpWood.toString(), {
+ size: 150,
+ fill: 0xFFFFFF
+});
+hpWoodText.anchor.set(0.5, 0);
+hpWoodText.y = scoreText.height;
+LK.gui.top.addChild(hpWoodText);
// Add a click event to the game
game.down = function (x, y, obj) {
// Trigger a character animation sequence
currentAssetIndex = (currentAssetIndex + 1) % playerAssets.length;
A small piece of wood.
a hanging rope. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
piece_of_wood. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
Upgrade button. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
Gold_button_icon. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
crown. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
raw piece of wood. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
Metal. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
Chair. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
create a hand icon breaking a brick in half. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
Play_button. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
Diamond_icon. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
pixel person with black hair, black pants, black eyes, and blue clothes making a V with hands jumping in a rain of diamonds. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
Shop_icon. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows