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.

2D All the way! / Scramble, -(also interest for retro game comp)

Author
Message
Stevo
21
Years of Service
User Offline
Joined: 4th Oct 2002
Location:
Posted: 2nd Mar 2003 16:49
Hi, I've been trying to make a game of scramble, the problem is I dont know how to do the collision bettween the ship and the ground.

I've found a link about the game, its got screen shots etc. It was a really good game!

http://www.mjwilson.demon.co.uk/crash/03/cavernf.htm


ok thanks
Andy Igoe
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: United Kingdom
Posted: 3rd Mar 2003 02:21
It really does depend upon how you choose to display and store the 'map'.

I'd create either a memblock or an array with the cavern height information - probably at 20 pixel intervals or thereabouts and then use the line command to draw between the dots.

ie.

dim floor(100)
floor(0)=screen height()-200
for fl=1 to 100
floor(fl)=floor(fl-1)+rnd(20)-rnd(20)
next fl

function displayFloor(x)
horPos=0
for sx=x to x+10
horPos=horPos+20
line horPos,floor(sx),horPos+20,floor(sx+1)
next sx
endfunction

That's a very rough piece of code, mostly because i'm a little 'tiddly' as I write this - but it should be enough to get the idea.

Pneumatic Dryll, Outrageous epic cleric of EQ/Xev
God made the world in 7 days, but we're still waiting for the patch.

Login to post a reply

Server time is: 2024-04-23 09:47:06
Your offset time is: 2024-04-23 09:47:06