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 / Beginners Platform Game Collision Tutorial - DBPro

Author
Message
Scouseknight
20
Years of Service
User Offline
Joined: 15th Mar 2004
Location: Bootle, Merseyside, UK
Posted: 18th Apr 2004 21:21
I was asked to help someone out with collision detection for a platform game due to my platform game project Bruce Lee - here is the tutorial I sent if anyone is interested in such things :

http://www.skgpl.co.uk/projects/platformcollision/index.html

It is most definately for beginners only though.

Blue Shadow
20
Years of Service
User Offline
Joined: 6th Feb 2004
Location:
Posted: 18th Apr 2004 21:51 Edited at: 18th Apr 2004 21:52
oops double post! sorry.


Visit the Code Monkey's website at http://www.freewebs.com/codemonkeystudios
Blue Shadow
20
Years of Service
User Offline
Joined: 6th Feb 2004
Location:
Posted: 18th Apr 2004 21:51 Edited at: 18th Apr 2004 21:52
Once again ScouseKnight another ABSOLUTELY FANTASTIC tutorial. Well done. I've just read throuh it now and is great. It explains everything you need to know about how to program the basis for a platform game. This along with your other tutorial should definetly be stickied. You really are a great member of the community and a great help to all the newcomers out their.

We are currently developing a level editor for our platform game and i wondered if i could ask you for some advice. How would you construct the lvels. Would you export all of the data and then load it into Darkbasic or would you create the levels and then take a picture of these and then use your method of defining the collision zones. Or would you build a function into the level editor to define collision zones and have it write the co-ordinates to a file.

Cheers,

Michael

PS Good luck with your Bruce Lee game. I played the last demo and it was fantastic.


Visit the Code Monkey's website at http://www.freewebs.com/codemonkeystudios
Scouseknight
20
Years of Service
User Offline
Joined: 15th Mar 2004
Location: Bootle, Merseyside, UK
Posted: 18th Apr 2004 23:01
Thanks Michael

I would love to see the zones being able to be defined as part of the level editor - allow the user to define the zones, and export them as data statements.

In my Bruce Lee game, I actually store the zones in data statements - here is the zone loading code so you can see what I mean :



I used the pointing the paintbrush method to obtain the coordinates, but you could allow the designer to enter "Wall Mode" or something and draw the boxes he/she would want for walls, and export the data when the level was saved.

Blue Shadow
20
Years of Service
User Offline
Joined: 6th Feb 2004
Location:
Posted: 18th Apr 2004 23:49
We will definetly try and implement that into our level editor then. Thanks for all the great tutorials.

Cheers,

michael


Visit the Code Monkey's website at http://www.freewebs.com/codemonkeystudios
Blue Shadow
20
Years of Service
User Offline
Joined: 6th Feb 2004
Location:
Posted: 23rd Apr 2004 02:17
bump - People really should read this it's great.


Visit the Code Monkey's website at http://www.freewebs.com/codemonkeystudios
soapyfish
21
Years of Service
User Offline
Joined: 24th Oct 2003
Location: Yorkshire, England
Posted: 23rd Apr 2004 02:28
Just got a link to this from Michael, very good tut and will help me with the level ed loads. Thanks.

gamemad




HEY, YOU THERE, THE ONE READING THIS, WHY NOT VISIT OUR TEAM SITE.
Scouseknight
20
Years of Service
User Offline
Joined: 15th Mar 2004
Location: Bootle, Merseyside, UK
Posted: 23rd Apr 2004 04:04
Looking forward to your game - had a look on your website earlier - Michael and I help each other out quite a bit on here so I have a keen interest in your game - I'm quite new as well so it's good to share ideas and techniques.

Blue Shadow
20
Years of Service
User Offline
Joined: 6th Feb 2004
Location:
Posted: 24th Apr 2004 15:47 Edited at: 24th Apr 2004 15:56
That'd be great Scouseknight. Thanks for your feedback.


Visit the Code Monkey's website at http://www.codemonkeystudios.tk
Blue Shadow
20
Years of Service
User Offline
Joined: 6th Feb 2004
Location:
Posted: 8th May 2004 18:26
Hey Scouseknight. I thought i'd post my question in the post as its related and so that other people can benefit from them.

1)If you have big platforms (al la Sonic) where they are more than a certain depth do you have to define collision zones for the sides and bottoms of these.

2)If you have a ramp in your game what is the best way to define the collision zones. Would it work if you did lots of say 2 * 2 pixel zones and staggered them so that it gave the effect of moving down or up.

Thanks for your help,

Michael


Visit the Code Monkey's website at http://www.codemonkeystudios.tk
Blue Shadow
20
Years of Service
User Offline
Joined: 6th Feb 2004
Location:
Posted: 9th May 2004 19:19 Edited at: 9th May 2004 19:25
I've been following through the tutorial and it was all going smoothly until you call the function get_walls() and show_walls(). Then for some reason it just displays a black screen. If you delete the calls then it works fine.

Here is my full source code



I'd be grateful if anyone could look over the code to see if they can see whats wrong with it.

Cheers


Visit the Code Monkey's website at http://www.codemonkeystudios.tk
Scouseknight
20
Years of Service
User Offline
Joined: 15th Mar 2004
Location: Bootle, Merseyside, UK
Posted: 11th May 2004 03:28
Michael sorry for not replying earlier I have been away all weekend at the Spanish Formula One Grand Prix.

Having a cursory glance, I think you need to Set Current Bitmap 0 at the end of the Get_Walls function - I don't have my original source to hand but I am sure that is at least part of the problem.

I'll have a good look at the other questions too when I get back into the swing of things.

Blue Shadow
20
Years of Service
User Offline
Joined: 6th Feb 2004
Location:
Posted: 11th May 2004 21:40
Thanks for that. That worked a treat. Glad to hear that you had a good weekend.

Cheers,

Michael


Visit the Code Monkey's website at http://www.codemonkeystudios.tk

Login to post a reply

Server time is: 2024-11-26 16:26:08
Your offset time is: 2024-11-26 16:26:08