D
Dark Pyro
Guest
Hey guys!
Hope you're having a great year so far!
But... I have a question, eheheh
So, I'm currently developing this mini-game where you have a ball that bounces on platforms that keep on falling. I have limited the play area but a problem keeps popping up.
So my idea was, as soon as the player object touched the platform, the player would jump for a certain height and then fall down, and so on... Now, this is working kinda correct.
The player sprite slips through the platform just a bit, and then jumps when it should be pixel perfect collision.
But my main question problem is:
If the player jumps and collides with a platform, it freezes in that position, the platform keeps falling down and just as the platform completely passed through the player, he jumps... Obviously this wasn't intended but I'm not able to fix that, although I tried with a few diferent ways and functions.
Any help?
I'll leave some code here and a picture of this event.
--|| oPlayer Step Event ||--
--|| oPlatform Step Event ||--
Hope you're having a great year so far!
But... I have a question, eheheh
So, I'm currently developing this mini-game where you have a ball that bounces on platforms that keep on falling. I have limited the play area but a problem keeps popping up.
So my idea was, as soon as the player object touched the platform, the player would jump for a certain height and then fall down, and so on... Now, this is working kinda correct.
The player sprite slips through the platform just a bit, and then jumps when it should be pixel perfect collision.
But my main question problem is:
If the player jumps and collides with a platform, it freezes in that position, the platform keeps falling down and just as the platform completely passed through the player, he jumps... Obviously this wasn't intended but I'm not able to fix that, although I tried with a few diferent ways and functions.
Any help?
I'll leave some code here and a picture of this event.
--|| oPlayer Step Event ||--
Code:
#region //Reset Jump
if(place_meeting(x, y + 1, oPlatform)){
canJump = true;
}
#endregion
#region //Movement and Platform Collision
if(place_meeting(x + hSpeed, y, oPlatform)){
while(!place_meeting(x + sign(hSpeed), y, oPlatform)){
x += sign(hSpeed);
}
hSpeed = 0;
}
if(instance_place(x , y + oPlatform.spd, oPlatform) != noone){
vSpeed = 0;
}
x += hSpeed;
y += vSpeed;
Code:
y += spd;
Attachments
-
917 bytes Views: 3