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 / Help tying to recreate classic ZX Spectrum F1 game

Author
Message
DemonHill
18
Years of Service
User Offline
Joined: 20th Mar 2008
Location:
Posted: 16th Apr 2014 01:26 Edited at: 16th Apr 2014 01:29
I am trying to recreate this classic

http://www.youtube.com/watch?v=KzIDspcZYU0&feature=youtube_gdata_player

Fast forward video to the race section......

But I can't figure out hot to make the cars sprite scroll from right to left, with gaps and then reposition for next lap.

Do I create 24 sprites and display them (most off to the right) or do I use one two cars and swap sprites.

I know it seems simple, just need to know best way of implementing. Help and any code appreciated thx

Barry Pythagoras
12
Years of Service
User Offline
Joined: 14th Mar 2014
Location:
Posted: 16th Apr 2014 10:42 Edited at: 16th Apr 2014 10:55
You position the sprites off in the X screen width + 200 for example

Two sprites or more depending on how many cars you want.

Pseudo Code (Not real code)

x1 = screen width + 200 (or car width + 32)

Next Car

x2 = screen width + 400 (or you can wait until the other car has moved and make it 200 again).

Move them by positioning the sprites x1 = x1 - 1

or

x1# = x1# - 0.1

To get the speed right

Height is Y1 + 200 for example

If you want to keep it old style use increments of 8 pixels all the time. Draw cars to fit 8 pixel increments.
Virtual Nomad
Moderator
20
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 16th Apr 2014 23:17 Edited at: 16th Apr 2014 23:24
i'd use sprites for each car and do what barry's suggested.

in fact, i'd gone about coding a simple racer similarly, with your thread as inspiration, this morning.

using a single image of a formula race car and setting its diffuse made for cheap and easy variety. ie:


i then went on to prepare sprites based on the footage you'd linked to before i ran out of time to do more with this today:



you're welcome to them.
DemonHill
18
Years of Service
User Offline
Joined: 20th Mar 2008
Location:
Posted: 17th Apr 2014 12:19
@ Virtual, you absolute star, many thanks

Kevin Picone
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 18th Apr 2014 06:32 Edited at: 18th Apr 2014 06:35
can remember seeing a few tutorials on creating Out Run / Pole Position styled games.

Here's one
Lou's Pseudo 3d Page

How to build a racing game(June 22, 2012)

DemonHill
18
Years of Service
User Offline
Joined: 20th Mar 2008
Location:
Posted: 22nd Apr 2014 11:37
@ Virtual, care to share some more code ?

Login to post a reply

Server time is: 2026-07-07 06:48:06
Your offset time is: 2026-07-07 06:48:06