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 / starfield that go into middle of screen

Author
Message
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 4th Dec 2004 00:51
Hi All,

Looked in code base but can't find a starfield genator that goes into the screen, goes backwards.

eg: if you where at the back of a ship looking out the window that is flying foreward the stars are moving away from you.

hope some of you get what a I am trying to do.

In Space No One can Hear You Scream! (When your comm Line is cut?)
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 5th Dec 2004 05:44 Edited at: 5th Dec 2004 16:39
Novel method ...





HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 20th Dec 2004 23:07
The above code is diffrent , but not what I am looking for, just want an ordanary star fleid, that is in the 2d format for use in dbp.

In Space No One can Hear You Scream! (When your comm Line is cut?)
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 20th Dec 2004 23:40 Edited at: 20th Dec 2004 23:42
Ahh, retro - I'll ramble some code off that probably won't work - but I'll check back when I get home and fix it.




Van-B


It's c**p being the only coder in the village.
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 20th Dec 2004 23:50
very good from memory, only they go the worng way they come out from the middle of screen, I would like them to go the other way, i wait till you get home and try something else. its what i am looking for in design.

In Space No One can Hear You Scream! (When your comm Line is cut?)
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 21st Dec 2004 00:39
Nice one Van. Just tinkered with a bit (hope you don't mind) to get it going the other way, and to avoid strange effects when the radius is greater than the screen size:




HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 21st Dec 2004 00:54
Cheers Van B and Ric, thats just what I am looking for, one bit down. now to look at how it works then to add the cross hairs, ships, sound and shots

Ps can i make a sprite start off very small and then become bigger as it gets closer to you?

In Space No One can Hear You Scream! (When your comm Line is cut?)
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 21st Dec 2004 01:33
Yeah, you can scale and rotate sprites really easily, just remember the offset command so it rotates and scales on the right spot. Look at the help screens for these commands:

SCALE SPRITE
SIZE SPRITE
OFFSET SPRITE
ROTATE SPRITE

There's an example too, check the showcase example with the sprite commands.

Ric,
No worries, I'm surprised it even worked! - thanks for fixing it.


Van-B


It's c**p being the only coder in the village.
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 21st Dec 2004 02:14
Ok got it doing part of what I want, but how do I get more than one box (ship) on the screen at once.

trying to get the ship bigger after a time as it gets closer?

In Space No One can Hear You Scream! (When your comm Line is cut?)
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 21st Dec 2004 03:03
You simply use different numbers for your sprite, like if you use something like:

SPRITE 1,100,100,1

To make another, you'd use:

SPRITE 2,150,100,1

And that'd make another sprite 50 pixels to the right of the first sprite.


Van-B


It's c**p being the only coder in the village.
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 21st Dec 2004 03:56
Ok have now got diffrent speeds ships I wanted but can not get them to grow bigger as they get closer to you.

any one see how to make them get bigger in relation to there speed?

In Space No One can Hear You Scream! (When your comm Line is cut?)
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 21st Dec 2004 10:34 Edited at: 21st Dec 2004 11:03
Can't help thinking maybe your thinking about this the wrong way - if you want the ships to appear to get bigger as they get closer to you, then you should be using the 3d commands. That way, DB takes care of the resizing of objects as they get closer to you.

eg:



I guess it depends - what you are trying to do in your game?


HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 22nd Dec 2004 01:45
Thanks Ric, so simple to do when some else show you but just could not see how to do it my self.

This way is going to make shooting easier to check, and remove object. just about undstand that bit.

cheers till the next code porb.

In Space No One can Hear You Scream! (When your comm Line is cut?)
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 22nd Dec 2004 02:51
Ok I am trying to use the crosshairs as used in one of the help prog showing how to use the joystick commands.

What's me prob well I have put this line in my code

load image "crosshair.bmp",2

however when I run it, say cannot find file "crosshair.bmp"

Why its on my hard drive? I have tried using the media add bit but that comes up with same sort of error.

Where am I going wrong, can do it ok if I put the full path name in but thought you didn't have to do that

In Space No One can Hear You Scream! (When your comm Line is cut?)
demons breath
21
Years of Service
User Offline
Joined: 4th Oct 2003
Location: Surrey, UK
Posted: 22nd Dec 2004 05:40
you don't put the full path name in if the file is in the directory your program is in. Copy your bitmap to whatever directory your file is in.

Am I the only one here who's really confused?
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 22nd Dec 2004 06:03
so its make many copies in diffrent dirs instead of using one.

In Space No One can Hear You Scream! (When your comm Line is cut?)
Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 22nd Dec 2004 06:38
no..you could use the file you have, but `puters are amazingly dumb, unless you tell it the whole path to the image (like c:\my folder\my art\starblaster art\small images\crosshair.bmp) then

load "crosshair.bmp",1

won`t cut it, but by default DB will look in the project folder for the media, so if you stick crosshair.bmp in the folder then DB can find it, DB isn`t going to search the whole PC for your file and then know that thats the one you want etc, you have to either give it the file it wants or point it right at it, the best bet is to put it in the folder with the game (otherwise someone who plays your game would have to have the crosshair in the same location as you have (eg: c:\my folder\my art\starblaster art\small images\crosshair.bmp) .

Mentor.

PC1: P4 3ghz, 1gig mem, 3x160gig hd`s, Radeon 9800pro w cooler (3rd gfx card), 6 way speakers.
PC2: AMD 2ghz, 512mb ram, FX5200 ultra, 16 bit SB.
Mini ATX cases suck.

Login to post a reply

Server time is: 2024-11-27 16:35:40
Your offset time is: 2024-11-27 16:35:40