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 / I've had dbpro for ages and i still dont know how sprite games work

Author
Message
Terabyte
23
Years of Service
User Offline
Joined: 28th Dec 2002
Location: UK
Posted: 19th Mar 2003 22:29
I've had dbpro for ages and i still dont know how sprite games work.
do you position the sprites like you do in 3d except without the z co-ordinate and move your camera. or do you keep your camera still and move a hundred odd sprites across the screen.
I have a word of advice...
..don't piss on an electric fence!
rapscaLLion
23
Years of Service
User Offline
Joined: 29th Aug 2002
Location: Canada
Posted: 19th Mar 2003 22:37
well you must be stupid then...
lol jks

Sprites are 2D only, they have no depth, and can only be moved on two dimensions, X and Y. Moving the camera has no effect on them, they are not part of the 3D environment! Think of them like pasting bitmaps on the screen, with moer advanced features.

That being said, Sprites are drawn using the 3D engine because it is faster than blitting (I think thats the term) on top of the 3D. They will always appear on top of text, 3D and pasted images.

I think that's it... basically it's for 2D games or HUDs or something.

Alex Wanuch
aka rapscaLLion
Kousen Dev Progress >> Currently Working On Editors
Superbeest
23
Years of Service
User Offline
Joined: 9th Mar 2003
Location: Netherlands
Posted: 19th Mar 2003 22:50
Perhaps you can try some tutorials about sprites? Worked for me. And trying a lot.

By steel will thy flesh divide
Terabyte
23
Years of Service
User Offline
Joined: 28th Dec 2002
Location: UK
Posted: 19th Mar 2003 22:59
that doesnt help guys
im aware that sprites have no depth to them.
i still havnt had any answers though.
are you saying that to produce a scrolling game all the sprites have to be moved at the same time

I have a word of advice...
..don't piss on an electric fence!
HZence
23
Years of Service
User Offline
Joined: 9th Mar 2003
Location:
Posted: 19th Mar 2003 23:04
lol...

I can tell you went right into DB for games programming. If you were programming in any other language where the is no "sprite" command you'd know how 2D works - and it is WAY simpler than 3D (that may not be true for DB though).

Andy Igoe
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: United Kingdom
Posted: 20th Mar 2003 00:51
the x and y co-ordinate of the sprite is NOT a 3D co-ordinate, it is a screen co-ordinate exactly the same as you give the text command. It is in no way influenced by the 3D camera.

I hope that helps.

Pneumatic Dryll, Outrageous epic cleric of EQ/Xev
God made the world in 7 days, but we're still waiting for the patch.
Terabyte
23
Years of Service
User Offline
Joined: 28th Dec 2002
Location: UK
Posted: 20th Mar 2003 01:22
but how do you get sprites to scroll across the screen i mean sprites that are off the screen.
sorry thats a bad question erm.
if you design a scrolling game how do you make it scroll. do you have to move every sprite one place to the left every time you want to move your character
[img] [/img]

I have a word of advice...
..don't piss on an electric fence!
Richard Davey
Retired Moderator
24
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 20th Mar 2003 02:06
Quote: "do you have to move every sprite one place to the left every time you want to move your character"


Pretty much, yes.

Obviously there are faster methods, but in essence that is what you'd do.

Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
DB Team / Atari ST / DarkForge / Retro Gaming
Terabyte
23
Years of Service
User Offline
Joined: 28th Dec 2002
Location: UK
Posted: 20th Mar 2003 10:18
thanks!
[img] [/img]

I have a word of advice...
..don't piss on an electric fence!
Terabyte
23
Years of Service
User Offline
Joined: 28th Dec 2002
Location: UK
Posted: 20th Mar 2003 14:23
hey wait a minute
are you telling me that if i have a hunderd sprites on the screen then a soon as i want to move to scroll left then i have to do this where max_sprites would be a value i set for the number of sprites on the screen




im not on my computer at the moment so i cant check dark basic pro for the correct syntax but something like that

seems a bit of a drag and i would of thought that the screen refresh rate would go down dramaticly.

surely there is anther way

I have a word of advice...
..don't piss on an electric fence!
Andy Igoe
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: United Kingdom
Posted: 20th Mar 2003 23:57
The problem is you are tackling the 2D subject with a 3D mindset.

Sprites are really very fast so moving them all, cycling textures, shrinking them, rotating them - it's all very fast. You arn't drawing that 40000 polygon obsenity your modeller sent you - it's just a texture.

Personally I create a display function that redraws everything every cycle, here's a simplified version to give you an 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: 2026-07-10 17:18:39
Your offset time is: 2026-07-10 17:18:39