Code edit (14 edits merged)
Please save this source code
User prompt
add the opponent health bar at the top of the screen
Code edit (1 edits merged)
Please save this source code
Code edit (12 edits merged)
Please save this source code
User prompt
in handleHitImpact when KO call game over
Code edit (1 edits merged)
Please save this source code
Code edit (6 edits merged)
Please save this source code
User prompt
add a new class HealthBar
Code edit (1 edits merged)
Please save this source code
User prompt
in punch function, increase self.currentPunchEnergy when punchCount is high, restore it to self.basePunchEnergy when its low
Code edit (2 edits merged)
Please save this source code
User prompt
in punch, count the number of punches per second
Code edit (18 edits merged)
Please save this source code
User prompt
when Athlete punched, reduce his energy by 2
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: self.bg is undefined' in or related to this line: 'self.fill = self.attachAsset('energyBarFill', {' Line Number: 355
Code edit (3 edits merged)
Please save this source code
User prompt
in EnergyBar class, add a energyBarBackground asset
Code edit (7 edits merged)
Please save this source code
User prompt
in EnergyBar class, add a lightning icon above
Code edit (1 edits merged)
Please save this source code
User prompt
in gameInitialize, Add the energy bar on the left
Code edit (1 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -533,12 +533,8 @@
/****
* Game Code
****/
-// Initialize Opponent Health bar
-var opponentHealthBar = game.addChild(new HealthBar(100));
-opponentHealthBar.x = 1024; // Center horizontally
-opponentHealthBar.y = 50; // Position at the top of the screen
/****************************************************************************************** */
/************************************** GLOBAL VARIABLES ********************************** */
/****************************************************************************************** */
var isPlaying = false;
@@ -552,8 +548,9 @@
var swipeEnd = null;
var playerEnergyBar = null;
var playerGuardBar = null;
var playerHealthBar = null;
+var opponentHealthBar = null;
var isDebug = true;
var debugMarker;
/****************************************************************************************** */
/************************************** POSTURES ****************************************** */
@@ -667,8 +664,12 @@
// Initialize Player Health bar
playerHealthBar = game.addChild(new HealthBar(100));
playerHealthBar.x = 1024;
playerHealthBar.y = 1960;
+ // Initialize Opponent Health bar
+ opponentHealthBar = game.addChild(new HealthBar(100));
+ opponentHealthBar.x = 1024; // Center horizontally
+ opponentHealthBar.y = 50; // Position at the top of the screen
if (isDebug) {
// Debug Marker
debugMarker = LK.getAsset('debugMarker', {
anchorX: 0.5,
clear
basic light gray convex round button with a red boxing glove icon. UI
Un gant de boxe bleu vu de dessus. video game
basic light round convex gray button with a raised blue shield icon.. UI
un éclair. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
remove
a basic white heart.. game icon
A boxer has lost the match..
man boxer with red gloves is KO on the ring..