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.

Newcomers DBPro Corner / Platformer Collision Help

Author
Message
Turkey_Man
14
Years of Service
User Offline
Joined: 17th Mar 2010
Location:
Posted: 27th Mar 2010 08:08 Edited at: 27th Mar 2010 12:11
I am trying to develop a 2D platformer, and I can't make any collision happen between the player and the platform






Whenever I start the program, Mario just falls though, And I want him to stop on the brick.
Kira Vakaan
15
Years of Service
User Offline
Joined: 1st Dec 2008
Location: MI, United States
Posted: 27th Mar 2010 13:08
Well for one, you seem to be loading your level on every loop through your program. You should really have a LoadBricks sub before your main loop, and then a DrawBrick sub inside it. Something like that.

But your problem actually lies in the fact that you only paste the sprite where you want bricks. There isn't actually a sprite there. The only brick you'd be able to land on is the one that's hiding out at 999,999.
Ashingda 27
16
Years of Service
User Offline
Joined: 15th Feb 2008
Location:
Posted: 27th Mar 2010 18:35 Edited at: 27th Mar 2010 18:36
There is only one brick sprite and you check collision with that single brick! Paste sprite has no effect on sprite collision.

Before you go any farther you must learn and understand a few collision methods. Personally I would never use sprite collision as there are much more simpler and flexible ways to get the same thing done.

You really should should search and look at other people's posts, there's one just a little bit down on this page that may be of help.
http://forum.thegamecreators.com/?m=forum_view&t=167597&b=7

Login to post a reply

Server time is: 2024-11-23 20:01:23
Your offset time is: 2024-11-23 20:01:23