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 / Really Stupid but quick question

Author
Message
sponge008
20
Years of Service
User Offline
Joined: 8th Feb 2004
Location: MA, USA
Posted: 28th Feb 2004 22:36
Sorry, but I'm new to 2D programming. Anyways, how do you make a side-scrolling game in 2D? (AKA have it end after say 10000 pixels across) And I don't know how to reposition the camera in 2D.
Tim Ballisto
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Right behind you.
Posted: 28th Feb 2004 22:56
make a plain and texture it for the background, and then move it left when you need to, and then after the plain has reached a certain point, make the level end. sorry if this is vague, all of my games so far are 3d (aside from text adventures)
sponge008
20
Years of Service
User Offline
Joined: 8th Feb 2004
Location: MA, USA
Posted: 29th Feb 2004 00:17
Yeah, I didn't really get anything out of that. Also, when I randomly position clouds, how do I make it so that the cloud repositions only after it's left the screen? (and so that it repositions out of the screen) Man, maybe I should just do this in 3D.
BearCDPOLD
20
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 29th Feb 2004 08:55
What Tim Ballisto was trying to explain is how to do a 2d side scrolling game using 3d techniques. I don't quite know what type of scrolling you're looking for (level scrolling, paralax scrolling, etc.). For paralax scrolling just make sure you have two sprites. One is the main background that scrolls in one direction so far every second, and another is the seconday background image the scrolls in the opposite direction so far every second.
For scrolling the 2d level, you could create a point at which the little Mario type character (sorry, whenever I think of 2d platform I think of Mario)cannot go any further past the screen until the level runs out. At that point you can just scroll the level.

To do the cloud thing have some math that knows the x and y size of the cloud image, then if the image is so far past the edge of the screen (say you're in 640,480, cloud is 32x32, if cloudimage x is 640+32) then position it on the left side of the screen out of range by however units big it is (carrying over from the previous example -32).
You can still do it using 2d commands, or you can just texture all your images onto plains and move the plains around like sprites in 3d.

Crazy Donut Productions
Current Project: KillZone
sponge008
20
Years of Service
User Offline
Joined: 8th Feb 2004
Location: MA, USA
Posted: 29th Feb 2004 17:07 Edited at: 29th Feb 2004 17:08
OK, I think I'll just do this in 3D, hehe. But still, how do I make it so the clouds don't reposition? Like this? Say the cloud is sprite 1.

look good?
BTW, could I just make a line at say, 15000,0,15002,480 and make a collision thing with the sprite and the line?

Login to post a reply

Server time is: 2024-09-21 23:57:29
Your offset time is: 2024-09-21 23:57:29