Code edit (10 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'x')' in or related to this line: 'self.leftFoot.x += (self.targetPosture.leftFoot.x - self.leftFoot.x) * speed;' Line Number: 116
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'x')' in or related to this line: 'self.rightFoot.x += (self.targetPosture.rightFoot.x - self.rightFoot.x) * speed;' Line Number: 113
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'x')' in or related to this line: 'self.leftHand.x += (self.targetPosture.leftHand.x - self.leftHand.x) * speed;' Line Number: 108
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'x')' in or related to this line: 'self.rightHand.x += (self.targetPosture.rightHand.x - self.rightHand.x) * speed;' Line Number: 104
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'x')' in or related to this line: 'var handsAndLegsReached = Math.abs(self.rightHand.x - self.targetPosture.rightHand.x) < 1 && Math.abs(self.rightHand.y - self.targetPosture.rightHand.y) < 1 && Math.abs(self.leftHand.x - self.targetPosture.leftHand.x) < 1 && Math.abs(self.leftHand.y - self.targetPosture.leftHand.y) < 1 && Math.abs(self.rightLeg.x - self.targetPosture.rightLeg.x) < 1 && Math.abs(self.rightLeg.y - self.targetPosture.rightLeg.y) < 1 && Math.abs(self.leftLeg.x - self.targetPosture.leftLeg.x) < 1 && Math.abs(self.leftLeg.y - self.targetPosture.leftLeg.y) < 1 && Math.abs(self.head.x - self.targetPosture.head.x) < 1 && Math.abs(self.head.y - self.targetPosture.head.y) < 1 && Math.abs(self.rightFoot.x - self.targetPosture.rightFoot.x) < 1 && Math.abs(self.rightFoot.y - self.targetPosture.rightFoot.y) < 1 && Math.abs(self.leftFoot.x - self.targetPosture.leftFoot.x) < 1 && Math.abs(self.leftFoot.y - self.targetPosture.leftFoot.y) < 1;' Line Number: 83
User prompt
we will simplify the athlete : remove hands and foots
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
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
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (2 edits merged)
Please save this source code
User prompt
links parts so that when rightArm moves, rightHand follow it
Code edit (1 edits merged)
Please save this source code
User prompt
no its in the middle now, fix
User prompt
no his head is under the trunk, fix
User prompt
skeleton head is in the middle of the trunk. fix that
User prompt
fix the skeleton and its animation
User prompt
animate the skelton
User prompt
add a new instance of skeleton in the game
User prompt
implement a skeleton using bodyparts like current athlete but with methods to control it
===================================================================
--- original.js
+++ change.js
@@ -38,58 +38,33 @@
scaleX: 1,
scaleY: 0.5,
tint: self.tint
});
- self.rightHand = self.rightArm.attachAsset('bodyPart', {
- anchorX: 0,
- anchorY: 1,
- scaleX: 2,
- scaleY: 0.5,
- tint: self.tint,
- visible: 1
- });
+ // Right hand asset attachment removed
self.leftArm = self.trunk.attachAsset('bodyPart', {
anchorX: 0.5,
anchorY: 1,
scaleX: 1,
scaleY: 0.5,
tint: self.tint
});
- self.leftHand = self.leftArm.attachAsset('bodyPart', {
- anchorX: 0.5,
- anchorY: 0.5,
- scaleX: 1,
- scaleY: 1,
- tint: self.tint
- });
+ // Left hand asset attachment removed
self.rightLeg = self.trunk.attachAsset('bodyPart', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 1,
scaleY: 0.5,
tint: self.tint
});
- self.rightFoot = self.rightLeg.attachAsset('bodyPart', {
- anchorX: 0.5,
- anchorY: 0.5,
- scaleX: 1,
- scaleY: 1,
- tint: self.tint
- });
+ // Right foot asset attachment removed
self.leftLeg = self.trunk.attachAsset('bodyPart', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 1,
scaleY: 0.5,
tint: self.tint
});
- self.leftFoot = self.leftLeg.attachAsset('bodyPart', {
- anchorX: 0.5,
- anchorY: 0.5,
- scaleX: 1,
- scaleY: 1,
- tint: self.tint
- });
+ // Left foot asset attachment removed
// FUNCTIONS
self.updatePosture = function () {
var speed = 0.2; //0.1; // Speed of transition
if (!self.targetPosture) {
@@ -199,12 +174,12 @@
/****
* Game Code
****/
-// Enumeration for game states
/****************************************************************************************** */
/************************************** GLOBAL VARIABLES ********************************** */
/****************************************************************************************** */
+// Enumeration for game states
var GAME_STATE = {
INIT: 'INIT',
MENU: 'MENU',
HELP: 'HELP',
Elongated elipse with black top half and white bottom half.
full close and front view of empty stands. retro gaming style
delete
delete
Basquettes à ressort futuriste. vue de profile. Retro gaming style
a blue iron man style armor flying. Retro gaming style
a blue iron man style armor flying horizontally. Retro gaming style
round button with a big "up" arrow icon and a small line under it. UI
A big black horizontal arrow pointing left with centred text 'YOU' in capital letters, painted on an orange floor.. horizontal and pointing left
remove
gold athletics medal with ribbon. retro gaming style
a black oval with a crying smiley face.