===================================================================
--- original.js
+++ change.js
@@ -439,16 +439,18 @@
self.targetX = ring.leftCorner;
} else {
self.targetX = ring.rightCorner;
}
- self.targetY = other.targetY == ring.bottomCorner ? ring.topCorner : ring.bottomCorner;
+ //self.targetY = other.y > 1044 || other.targetY == ring.bottomCorner ? ring.topCorner : ring.bottomCorner;
+ self.targetY = self.y < 1044 ? ring.topCorner : ring.bottomCorner;
} else {
if (other.y > 1044) {
self.targetY = ring.topCorner;
} else {
self.targetY = ring.bottomCorner;
}
- self.targetX = other.targetX == ring.bottomCorner ? ring.rightCorner : ring.leftCorner;
+ //self.targetX = other.x < 1024 || other.targetX == ring.leftCorner ? ring.rightCorner : ring.leftCorner;
+ self.targetX = self.x > 1024 ? ring.rightCorner : ring.leftCorner;
}
} else {
if (self.isPlayer) {
log("PLAYER ATTACK !!! self.energy=" + self.energy);
@@ -723,8 +725,32 @@
};
self.updateHealth(100);
});
/****************************************************************************************** */
+/************************************* PROJECTIONS CLASS ********************************** */
+/****************************************************************************************** */
+var Projections = Container.expand(function () {
+ var self = Container.call(this);
+ // Projection properties
+ self.speed = 5; // Speed of the projection
+ self.direction = 0; // Direction of the projection in radians
+ // Create and attach a projection asset
+ var projectionGraphics = self.attachAsset('projection', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ // Update function for the projection
+ self.update = function () {
+ // Move the projection based on its speed and direction
+ self.x += Math.cos(self.direction) * self.speed;
+ self.y += Math.sin(self.direction) * self.speed;
+ // Check if the projection is out of bounds and destroy it if so
+ if (self.x < 0 || self.x > 2048 || self.y < 0 || self.y > 2732) {
+ self.destroy();
+ }
+ };
+});
+/****************************************************************************************** */
/************************************* PUNCH BUTTON CLASS ********************************** */
/****************************************************************************************** */
var PunchButton = Container.expand(function () {
var self = Container.call(this);
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..