You are not logged in.
Pages: 1
I'm using some code which allows my character to be knocked back after jumping on top of a spike. So far this works, but I'm encountering a problem whereby my character will continue to move into any nearby wall objects once the effect begins. I know that place_free is normally used to correct this, but the wall clipping glitch still occurs. I've highlighted this additional code in red. Can anyone help me out?
Many thanks.
//Spike Knockback
if place_meeting (x,y+10,obj_spike)
{
if other.x > x
hspeed = -4
else
hspeed = 4
vspeed = -4
}
if abs(hspeed) > .5
hspeed *= .8
else
hspeed = 0
if place_free(x+hspeed,y)
{
if abs(hspeed) > .5
hspeed *= .8
else
hspeed = 0
}
Offline
Hmm, no suggestions after all this time...? It's like a ghost town around here!!
In any case, I finally got a solution for this one so I'll update here. Replace the red code in the above post as follows:
if (place_free(x+hspeed,y)){}
else
hspeed=0;
Last edited by Odolwa (2013-09-04 15:48:42)
Offline
I'm afraid you are right. This forum sees very little activity. I check it most days and saw your question but I didn't have an answer for you.
Thanks for posting the solution.
Abusing forum power since 1986.
Offline
Pages: 1