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 / Need help with a little space sim?

Author
Message
Wolverine
21
Years of Service
User Offline
Joined: 28th May 2003
Location:
Posted: 28th May 2003 20:48
Hi, I am new to DarkBasic Pro and so I start by making a small game. You shall be able to fly with a space ship and shoot at a given amount of enemies to advance to the next level.

Now my question is, how can I make a movable background, so that the map on wich the ship flies is for example 4 times as big as the screen? And how can I make the ship stop from changing the flight direction when I rotate it? If you want to help me, please look at my source code. If you want to compile it, you need a ship.bmp. I used a car from GTA. Thnx
Wolverine
21
Years of Service
User Offline
Joined: 28th May 2003
Location:
Posted: 29th May 2003 17:04
Now I have added a velocity to the ship and I made it so, that when the ship reaches the screen end, it jumps to the opossite site. But I can't figure out how to make the ship draft when I am turning, without directly flying into this direction. Under the source tab is my new code.
Flashing Blade
21
Years of Service
User Offline
Joined: 19th Oct 2002
Location: United Kingdom
Posted: 29th May 2003 19:37
you need to manipulate the x&y velocities
i've diddled with your code - hope this is what u want:
Flashing Blade
21
Years of Service
User Offline
Joined: 19th Oct 2002
Location: United Kingdom
Posted: 29th May 2003 20:31 Edited at: 29th May 2003 20:34
use this code instead (i made shipx & shipy real numbers - makes it a bit smooooother):

**Edit**
oops change line 7 to LOAD IMAGE "ship.bmp",1
Wolverine
21
Years of Service
User Offline
Joined: 28th May 2003
Location:
Posted: 29th May 2003 22:06
Thnx, that is exactly what I wanted. But now the ship only flies in 8 directions, it looks a bit funny, when you rotate the ship in a circle while you are thrusting. Do you now how to change this, too?

Thnx for your help
Flashing Blade
21
Years of Service
User Offline
Joined: 19th Oct 2002
Location: United Kingdom
Posted: 30th May 2003 14:05
make all variables real to make everything smoother.

I see what you mean when turning whilst thrusting. I'd experiment with it 'til i got things right. Or you could look at the retro compo source codes (there must be at least 1 asteroids game in there).
The thing I was trying to point out was that you need to manipulate the x & the y velocities.
Wolverine
21
Years of Service
User Offline
Joined: 28th May 2003
Location:
Posted: 30th May 2003 22:48
Thnx for the help, I will experiment a bit with the velocities.
BTW, I looked at the Retro Comp entries, there is only one 2D Asteroids Clone and this one (Super Stardust 3D Delta) is like my first code. The ships velocity changes when you turn the ship, so it is of no use

Login to post a reply

Server time is: 2024-09-20 09:33:10
Your offset time is: 2024-09-20 09:33:10