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 / Driving, 2D maps and object placement

Author
Message
Crabbages
14
Years of Service
User Offline
Joined: 12th Aug 2010
Location:
Posted: 25th Jan 2011 20:16
Hello everyone.

After looking through the tutorials on driving games and i thought it would be nice to try my hand at a 2D version. Unfortunatly 2D aint what it used to be and guidance is a little hard to find.
Anyway thanks to the lovely people on the TGC forums Im pretty confident with physics and so on.

However this is beyond me.
It's a little game found lying around java-gaming.org;
http://daid.mine.nu/pub/LD13_DigitalRoadJam_final.zip


Whenever i place objects they appear on what would be my HUD
So question is how was this achieved? (Is it actually 2D? Its amazing what hes actually managed with it.)

Now i don't expect anyone to type up exactly whats happening but a little insight into the method used would help greatly.

Thanks for your time.
I hope I havn't made a fool of myself but if nothing else atleast now you have a nice little driving game.
29 games
18
Years of Service
User Offline
Joined: 23rd Nov 2005
Location: not entirely sure
Posted: 26th Jan 2011 19:31
Hi Crabbages

I quite enjoyed the driving game.

I'm not sure how they achieved this. I'm pretty sure that you could do it all 2D but I probably wouldn't, unless it was a straight top down view.

My method would be to do it in 3D and use plains for all the objects, a bit like this (no collision implemented):




The only real problem with doing this is that all the roads end up at 90 degrees to each other (which might not matter for a first go at a game like this) and I'm not entirely sure how well any collision commands (native DBP or sparky's dll) will cope with the 2D plains being all on the XZ plain, but this is something you can experiment with if you go down this route.


Hope this helps.
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 27th Jan 2011 13:33
I would suggest using a map editor (you could write it yourself or search) to lay out a 2D tile map to get the 'road' to look like you want and then save this array to a file. Then I would load the array into the game and create a memblock based upon the car's position on the map. (I am not a maiven of memblocks, but there are several examples on this forum). You could use a particular color on the outside of the road edges so that you could check for it in the memblock to see if a collision has occurred.

I think you could search for "2D tile" and come up with some examples.

Personally, I thought the car's movement in this app was a little sluggish, but maybe it is my computer.

Good luck with it.

Crabbages
14
Years of Service
User Offline
Joined: 12th Aug 2010
Location:
Posted: 29th Jan 2011 18:28
Thanks for the help guys. 29's post solved my problem (then created a new one aaaaargh)
I'll try and make the same track with both methods suggested and see which I prefer.

Login to post a reply

Server time is: 2024-09-29 00:20:46
Your offset time is: 2024-09-29 00:20:46