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! / Working platrorms for sprites

Author
Message
Seph
21
Years of Service
User Offline
Joined: 3rd Oct 2002
Location:
Posted: 4th Oct 2002 20:05
Okay, so I have a nice little basic engine with gravity, a jump, a moving sprite, and one problem-- whenever the sprite jumps onto a higher platform, and doesn't quite make it, it gets stuck in the platform, and moves all through it.

Any way to work around this? Thanks.
Seph
21
Years of Service
User Offline
Joined: 3rd Oct 2002
Location:
Posted: 4th Oct 2002 20:06
Oh, one quick note, I'm using DarkBASIC original, not pro.

The Darthster
21
Years of Service
User Offline
Joined: 25th Sep 2002
Location: United Kingdom
Posted: 4th Oct 2002 23:14
Can you give more information about the engine and the problem, possibly posting some code?
Seph
21
Years of Service
User Offline
Joined: 3rd Oct 2002
Location:
Posted: 5th Oct 2002 01:09


All of that is the collision code I use.

funkydude
20
Years of Service
User Offline
Joined: 4th May 2003
Location:
Posted: 4th May 2003 13:55
Do you have the full source code demo of this? Let me know!

RaverDave
20
Years of Service
User Offline
Joined: 30th Apr 2003
Location:
Posted: 5th May 2003 01:09 Edited at: 5th May 2003 01:10
Well,there is a couple of ways to do this, firstly you can use colour detection..abit compicated,but on a seperate bitmap you would place all platforms say in red with a border colour(sides of the platform) say brown?!,and stop its x-coord speed if it hits brown or its y-coord speed if it hits red of course..another simpler way is just to have another sprite (lets call it a depth marker) just under the characters feet..you can make this invisible..and if it is colliding with anything then move it up..of course you make the character relative to the depth marker-chars height!

Armeggadon
20
Years of Service
User Offline
Joined: 10th Apr 2003
Location: United States
Posted: 5th May 2003 03:55
possibly do a sliding collision so if they hit the side they fall back down next to the object. i dont know how to do a sliding collision but i know theres some posts somewhere about them(lots of ppl used to ask)

Current Status: learning MORE about dbpro
I consider myself: newb

Login to post a reply

Server time is: 2024-03-28 18:50:23
Your offset time is: 2024-03-28 18:50:23