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! / how do I give a 2D picture life and make a world it can move in?

Author
Message
flaming squirel
20
Years of Service
User Offline
Joined: 10th Jan 2004
Location:
Posted: 23rd Jan 2004 03:26
I hear how ell DB makes 3D games but how good do they make 2D. Anywho i dont know how to make 2D plaese hellp!

the deep fryer burns me
comando 300
20
Years of Service
User Offline
Joined: 23rd Nov 2003
Location:
Posted: 23rd Jan 2004 05:18 Edited at: 23rd Jan 2004 05:24
download an art package and make your sprites.Or you can use the basic 2d commands.

Use something like this

load "image.bmp",1
x=250
y=250
sprite 1,x,y,1
do
if leftkey()=1 then sprite 1,x,y,1 : x=x-5
if rightkey()=1 then sprite 1,x,y,1 : x=x+5
loop

Is just of those days when you don't wanna wake up everything is *****, everybody sucks you really don't know why, but you wanna justify rippin' someone head off!
Tersaken
20
Years of Service
User Offline
Joined: 15th Dec 2003
Location: France ( Rennes )
Posted: 23rd Jan 2004 08:55 Edited at: 23rd Jan 2004 09:28
I'll not do like you,
First, Not use Sprite, It's very slow. ( Especially Dark Basic )
Second, The Loop Must display your picture in each turn
Have a Look :

`Init
Set Display Mode 640,480,32
Hide Mouse : Sync On : Sync Rate 30
`Media
Box 0,0,32,32
Get Image 1,0,0,32,32
`Main Loop
Do
Cls
Inc X,(Rightkey()-Leftkey() )*4
Inc Y,(Downkey() - Upkey() )*4
Paste Image 1,x,y
Sync
Loop



Athlon 1700+ ; 256 Mo DDR ; GeForce Fx 5600 128 Mo.
Pincho Paxton
21
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 23rd Jan 2004 10:37 Edited at: 23rd Jan 2004 11:41
Well yeah sprites are slow, but you can use maybe 10 small sprites if it makes collision easier. Images are better for games without collision, like card games, fruit machines, or simple collision, like tetris, and breakout. If you are new to making games then start with an easy game. The backgrounds are just pictures that you can draw in an art package. you can draw them as a full screen picture, or you can draw little 32*32 squares, and join them together like a jigsaw. Why use squares? Because you can use things like a grass square several times, and save memory. It's not so important to save memory for a small game. So draw a full screen, and do a simple game with a few sprites, until you get the hang of it.

Pincho.

Tersaken
20
Years of Service
User Offline
Joined: 15th Dec 2003
Location: France ( Rennes )
Posted: 23rd Jan 2004 14:26 Edited at: 23rd Jan 2004 14:30
I'm not agree with you,
You can easilly create 2d collisions with a dim, i'm going to give you an exemple, just look.
As you can See, this game is not finish, but it shows the collision with dim



If he's beginning, he can use sprites, but in the future, he'll dissover the real limit !

Good luck for you next creation !

Ps : we call this " Square " Tiles, it's very fast with images, i often use this technic, you've got here a help file http://melysoph.free.fr/Dark/Tutos/tiles.htm
But it's in french ! ( it's my own creation )

Athlon 1700+ ; 256 Mo DDR ; GeForce Fx 5600 128 Mo.
Pincho Paxton
21
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 23rd Jan 2004 14:43 Edited at: 23rd Jan 2004 14:45
Yeah I already said that Images were good for use with simple collision like squares.

Quote: "Images are better for games without collision, like card games, fruit machines, or simple collision, like tetris, and breakout."


It is also easy to do round collision on balls...so watch out! J/K! lol! But for strange shapes you could use sprites. I mean, you don't have to ignore sprites all the time, they are useful for some things.

Pincho.

Tersaken
20
Years of Service
User Offline
Joined: 15th Dec 2003
Location: France ( Rennes )
Posted: 23rd Jan 2004 19:16 Edited at: 23rd Jan 2004 19:24
Oups ! Sorry ! But anyway, don't use Sprite ! Ps : It's the french forum's opinion ! We are against the sprites, lol !

Athlon 1700+ ; 256 Mo DDR ; GeForce Fx 5600 128 Mo.
Sir Real
20
Years of Service
User Offline
Joined: 23rd Jan 2004
Location:
Posted: 23rd Jan 2004 21:48 Edited at: 23rd Jan 2004 21:49
Quote: "But for strange shapes you could use sprites."


Well, you could instead do ray collision with polygons instead. I cooked up this last night since I was trying to do pixelperfect collision using 2 images and the speed was horrible.





You'll have to excuse the low FPS, I have it drawing all the lines every loop while I'm testing.

SirReal
Pincho Paxton
21
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 23rd Jan 2004 21:56
Ok but I was concentrating on full 2D.

Sir Real
20
Years of Service
User Offline
Joined: 23rd Jan 2004
Location:
Posted: 23rd Jan 2004 22:58
Quote: "Ok but I was concentrating on full 2D."


So was I. Mind you, the example below was hand "drawn" to prove a point, but ray-polygon collision IS a form of 2d collision



See... the Tank can't go in the water ( though, for a real world use, you would use a better defined polygon running closer to the shore )
Tapewormz
21
Years of Service
User Offline
Joined: 15th Sep 2002
Location: Winnipeg, Mantoba, Canada
Posted: 13th Feb 2004 03:51 Edited at: 13th Feb 2004 05:02
Hey, that looks interesting Sir Real. Do you have a snip-it example of ray-polygon collision? I'd like to look at the math involved and try to understand it better. I understand the principal, but not the math.
Northern Fist
20
Years of Service
User Offline
Joined: 23rd Sep 2003
Location:
Posted: 13th Feb 2004 05:00
I'm trying to find some resources on 2D triangle/polygon collision myself.

"The keyboard is mightier than the sword."
...2D map editor with parallax layering in the works (60%completed)...

Login to post a reply

Server time is: 2024-05-13 02:13:32
Your offset time is: 2024-05-13 02:13:32