Page 1 of 1

I've had it up to here....

PostPosted: Wed Apr 06, 2011 7:41 pm
by BloodRedDragon
Soz, i'll try and be more polite next time.

CONTROLS: right ctrl to jump, shift to dash
Open this .ged and press Game Mode, if you could, and notice that as you keep jumping, you will reverse direction sometimes when you land. I have been toiling away for hours to work out as to why this is happening, but I have limited programming knowledge and thus cannot work it out.

+1 point will be given :D

Thankooo

Re: I've had it up to here....

PostPosted: Wed Apr 06, 2011 8:52 pm
by NERDnotGEEK
okay looking at your game.

your collision method works by make your xvelocity change direction by multiplying by -1
this works fine, but when your jumping and landing sometimes your character is colliding with the left and right top corner of your tile actor, and it is making it change direction as if its hitting the wall

if make your metal block actor into a tile actor, and build the level using tiles you wont get this problem.... but

I suggest using a different way to make your ball collide with the walls. this method has a lot of limitations.


so to summarise, as you land, it thinks its hitting the left or right side of the block, not the top.

Re: I've had it up to here....

PostPosted: Wed Apr 06, 2011 9:21 pm
by Game A Gogo
Try checking velocitys of the actor when colliding instead of using the "top side only", etc. since it will be more reliable to some extend. If you can't figure it out from here I'll check the ged for you

Re: I've had it up to here....

PostPosted: Wed Apr 06, 2011 9:58 pm
by BloodRedDragon
cheers both :D +1 point as promised. I will make adjustments as soon as I have time.

Re: I've had it up to here....

PostPosted: Wed Apr 06, 2011 10:14 pm
by BloodRedDragon
So how come tiling works better than clones? is it becuase it has more time to decide whether it is colliding with each side?
Also one of the reasons I did not use tiling is because the tiles do not snap to the grid.
What do you suggest for the code when the ball collides with left/right side? :D

Re: I've had it up to here....

PostPosted: Wed Apr 06, 2011 10:18 pm
by BloodRedDragon
EDIT: Iforgot you can snap tiles... DOH :(