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.

2D All the way! / 2D Platform Movement - Help!

Author
Message
DBAlex
21
Years of Service
User Offline
Joined: 4th Oct 2004
Location: United Kingdom
Posted: 12th Jun 2005 07:24 Edited at: 12th Jun 2005 07:25
Im trying to get platform movement in DBPro working.. I have the basics done, (Gravity, Jumping, Scrolling etc).

But collision isnt too good... When I hit a corner of the level diagonally the player goes straight through it.

Is there a way of doing my collision method (detecting white pixels) with a block instead of a pixel?

And thanks if you can help

Files Are Attached


AMD 64 3000 + 512mb RAM + 80GB HD + Radeon 9600se 128mb
http://www.dbastudios.cjb.net
DBAlex
21
Years of Service
User Offline
Joined: 4th Oct 2004
Location: United Kingdom
Posted: 12th Jun 2005 22:26
Can anyone help with this ?


AMD 64 3000 + 512mb RAM + 80GB HD + Radeon 9600se 128mb
http://www.dbastudios.cjb.net
D Ogre
22
Years of Service
User Offline
Joined: 19th Nov 2003
Location:
Posted: 14th Jun 2005 09:24
Try posting your problem as a code snippet.

You could use box collision. Define variables to store the locations of each corner of the block(s) and character. You would probably want to use an array. Once this is done, you make checks to see if your character is either near, just touching, or overlapping the block.
There is a nice tutorial here for this. Search for 2D side scroller tutorial. It was written by Pizzaman. It may answer any questions you have about doing this.

Login to post a reply

Server time is: 2026-06-12 09:25:46
Your offset time is: 2026-06-12 09:25:46