@@ -11,6 +11,8 @@ applies_to=self
1111 // -- Speeds
1212 xSpeed = 0 ; // -- Horizontal speed (ground and air)
1313 ySpeed = 0 ; // -- Vertical speed (airborne)
14+ xVelocity = 0 ; // -- Horizontal speed (read only)
15+ yVelocity = 0 ; // -- Vertical speed (read only)
1416
1517 // -- Terrain
1618 slopeHeight = 0 ; // -- Slope height used while going up
@@ -20,6 +22,7 @@ applies_to=self
2022 solidPlace = 0 ;
2123 platformPlace = 0 ;
2224 platformID = 0 ; // -- ID of the meeting platform
25+ meetingWall = false ;
2326
2427 // -- States
2528 action = actionNormal; // -- Current player state
@@ -90,7 +93,7 @@ applies_to=self
9093 !scrCollisionMain(x + xSpeed, y, collisionSolid) &&
9194 !scrCollisionMain(x + xSpeed, y + 1 , collisionSolid))
9295 {
93- x += xSpeed * global.idDelta ;
96+ x += xSpeed * global.delta ;
9497
9598 // -- Go down
9699 while (!(scrCollisionMain (x, y + 1 , collisionSolid)))
@@ -104,6 +107,8 @@ applies_to=self
104107 var collisionMain;
105108 collisionMain = scrCollisionMain (x + xSpeed, y, collisionSolid);
106109
110+ meetingWall = false ;
111+
107112 if (collisionMain)
108113 {
109114 slopeHeight = 0 ;
@@ -137,6 +142,7 @@ applies_to=self
137142 if (terrainCurrent != terrainPlatform)
138143 {
139144 xSpeed = 0 ;
145+ meetingWall = true ;
140146 }
141147 }
142148 else // -- Otherwise, we are moving up a slope
@@ -146,7 +152,7 @@ applies_to=self
146152 }
147153
148154 // -- Approach to the xSpeed
149- x += xSpeed * global.idDelta ;
155+ x += xSpeed * global.delta ;
150156 }
151157
152158 var collisionVertical, collisionLeave;
@@ -169,7 +175,7 @@ applies_to=self
169175 }
170176
171177 // -- Approach to the ySpeed
172- y += ySpeed * global.idDelta ;
178+ y += ySpeed * global.delta ;
173179/* "/*'/**/ /* YYD ACTION
174180lib_id=1
175181action_id=603
@@ -281,7 +287,7 @@ applies_to=self
281287 if (animFinished == false && animSpeed != 0 )
282288 {
283289 // -- Change the frame depending on the animation speed
284- animFrame += animSpeed*global.idDelta ;
290+ animFrame += animSpeed*global.delta ;
285291
286292 if (floor (animFrame) > animFrameEnd)
287293 {
@@ -310,15 +316,19 @@ applies_to=self
310316 if (place_meeting(x + xSpeed, y, physicalobj))
311317 {
312318 // -- Check if the object is touching a wall or another object
313- if place_meeting (physicalobj.x - 24 , physicalobj.y - 3 , parTerrain) // && scrPhysicsReturnDir(physicalobj) <= 0
319+ /* if place_meeting(physicalobj.x - 24, physicalobj.y - 3, parTerrain) //&& scrPhysicsReturnDir(physicalobj) <= 0
314320 || place_meeting(physicalobj.x + 24, physicalobj.y - 3, parTerrain) //&& scrPhysicsReturnDir(physicalobj) == 1
315321 {
316322 exit;
317323 }
318324 else
319325 {
320- physicalobj.xSpeed = (x - xprevious);
321- physicalobj.image_angle += x - xprevious;
326+ x -= sign(physicalobj.x - x);
327+ //physicalobj.image_angle += x - xprevious;
328+ }*/
329+ if (physicalobj.meetingWall == true )
330+ {
331+ xSpeed = 0 ;
322332 }
323333 }
324334/* "/*'/**/ /* YYD ACTION
@@ -337,6 +347,15 @@ applies_to=self
337347 instance_destroy ();
338348 }
339349 }
350+ /* "/*'/**/ /* YYD ACTION
351+ lib_id=1
352+ action_id=603
353+ applies_to=self
354+ */
355+ // / -- Velocity
356+
357+ xVelocity = (xprevious - x) / global.delta;
358+ yVelocity = (yprevious - y) / global.delta;
340359#define Draw_0
341360/* "/*'/**/ /* YYD ACTION
342361lib_id=1
0 commit comments