Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / 2D sprite collision placement

Author
Message
Fleep
14
Years of Service
User Offline
Joined: 1st Oct 2010
Location:
Posted: 24th Aug 2011 22:25
Hello there, so ive more or less got a functional collision system for a mario clone that im making, ive searched for a good few hours on the forums with no luck.
Here is what im looking for: http://forum.thegamecreators.com/?m=forum_view&t=186683&b=1
Van B's answer seems to be what im looking for but i cant seem to understand what he's there with that function.
I use this to figure out if a sprite is above or below another sprite,


What i cant seem to do is figure out how to see if the player is on the right or left side of the cube.
Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 7th Sep 2011 00:21 Edited at: 7th Sep 2011 00:22
if(dbSpriteX(mario)>dbSpriteX(allCollisions[1].Spriteid))dbPrint("mario colliding from RIGHT SIDE OF the brick"); //mario is RIGHT SIDE OF the brick
if(dbSpriteX(mario)<dbSpriteX(allCollisions[1].Spriteid))dbPrint("mario colliding from LEFT SIDE OF the brick"); //mario is LEFT SIDE OF the brick

Why won't this work?

The fastest code is the code never written.

Login to post a reply

Server time is: 2024-10-02 19:24:31
Your offset time is: 2024-10-02 19:24:31