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.

DarkBASIC Professional Discussion / 2D Race simulator

Author
Message
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 17th Jan 2012 21:04
Hi there. I have been trying to make a 2D motobike race retro style for android and decided to make it first in Dbpro. Long since I programmed games in 2D . I suppose that the track can be done in a data but I prefer to make a random track so the track appears and the player have to try to be on road. The game is goin to be something like old sega games like this video:

http://www.youtube.com/watch?v=TU2hm8ylv9w&feature=related

This is what I have so far.





Is there an easy way to make the track ?

Cheers.

I'm not a grumpy grandpa
CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 23rd Jan 2012 06:39
The old-style racing games of the 80s arcade days used a series of rectangles "stacked" on top of each other, which slid left and right at various speeds to give the illusion of a winding road. That'd be your best bet for a low-power system


chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 23rd Jan 2012 12:47
@CumQuaT
That's what I did...I suppose that in old retro games, they have all different values of the bends in a Data. I just put them randomly...what about adding a palm at a certain bend?

Cheers

I'm not a grumpy grandpa
CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 23rd Jan 2012 13:08
What you'd have is a list of offset numbers, 0 is when the road is perfectly centered, -100 is all the way to the left, etc, and make up your tracks that way. It would be easy to make loops that way as well. But basically, each iteration of the road would be assigned an offset value. That iteration could also be assigned a bit of scenery, such as a palm tree, so that when the road is up to drawing that iteration, it also draws that scenery, and applies the correct offset to it.

Does that make sense? I'm bad at describing things sorry :S


chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 23rd Jan 2012 15:09
Quote: "Does that make sense? I'm bad at describing things sorry :S"


Yes of course...it does !! and it works !!, if we have for example 50 pieces that make the road, we can decide that a palm tree or a lamp will be in the last limb(50) position but not every time but just random, so the palm tree starts being a littel palm and becomes larger as it approaches giving the impression that it really is in motion.

Thanks CumQuaT

I'm not a grumpy grandpa
CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 23rd Jan 2012 15:48
Not a problem! I build arcade machines for a hobby and have made this sort of game before


Login to post a reply

Server time is: 2026-07-10 15:30:49
Your offset time is: 2026-07-10 15:30:49