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! / 2D Sidescrolling Example

Author
Message
MakcKid
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location:
Posted: 20th Feb 2004 18:37
Hey. Does anyone have an example of a 2D sidescroller with collision? Thanks a lot!

.....
Pincho Paxton
21
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 20th Feb 2004 19:15 Edited at: 20th Feb 2004 19:19
Isn't there an R-Type example on the home page? I remember seeing one somewhere.

Yeah, here it is.


http://darkbasicpro.thegamecreators.com/?m=showcase_view&i=90

MakcKid
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location:
Posted: 20th Feb 2004 19:50
Thanks. But forget about the sidescrolling right now. Does anyone have a very simple example of a small 2d map you can walk around on with collision.
Thanks again!

.....
Prep
20
Years of Service
User Offline
Joined: 17th Nov 2003
Location:
Posted: 21st Feb 2004 00:18 Edited at: 21st Feb 2004 00:20
Right, scrollings something that you will most likely want to try in many different ways working out which works best for you and your game. Heres some very basic scrolling code. Hopefully it will give you some ideas. Its wrote for a 640x480 game area, 16x12 tiles.



I haven't tested that, and its not complete, you would need tiles and some data in the array to see if its truely working.

Should give you a good start though.

To be no more, sad cure.
MakcKid
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location:
Posted: 21st Feb 2004 00:23
Thanks a lot Prep. Does anyone have a collision example because I've been trying to figure out collision with arrays and data statements for a while, but I haven't got it yet. A simple 2D game where you walk around and there are walls that make you stop is what I'm looking for. Thanks a lot!

.....
Izzy545
20
Years of Service
User Offline
Joined: 18th Feb 2004
Location:
Posted: 21st Feb 2004 00:28
MakcKid, I sortof have an example in the 2D help thread. It uses basically the same way that you use arrays, i.e. when you move it keeps track of your position on the array. But the only thing is, I have it check for collision beforehand, making it much easier to handle it
Code Stealer
20
Years of Service
User Offline
Joined: 12th Feb 2004
Location:
Posted: 21st Feb 2004 01:18
Damn! We are all trying for the same thing, surely this has been handled befor in this forum? There must be plenty of code for collision detection and maps here...

GIve me more power!
Prep
20
Years of Service
User Offline
Joined: 17th Nov 2003
Location:
Posted: 21st Feb 2004 03:35
Its probably best to stick with the "2D" help for scrolling and collision on maps, easier for all to read / keep track of.

To be no more, sad cure.
glint
20
Years of Service
User Offline
Joined: 9th Feb 2004
Location: the Synth
Posted: 21st Feb 2004 06:59
I looked at Pincho's code snippet and I have a comment . . .

Is all the bitmap work really necessary? Couldn't you just use an array to paste several images and then repaste them with player updates? Or would this be too slow?

As far as collisions go, I would suggest using sprites for your walls. It is simple enough to check for collisions with them. Then again, this might also be too slow.
Pincho Paxton
21
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 21st Feb 2004 14:14
I haven't posted a snippet on here. Do you mean paste images on Bitmap 0. You still have to figure out a way to scroll the screen. You might find it more difficult to scroll the screen without some kind of glitches. If you go 3D, then you could just move the camera, no need for all this complicated scroll routine.

Prep
20
Years of Service
User Offline
Joined: 17th Nov 2003
Location:
Posted: 21st Feb 2004 16:35
Drawing operations on the veiwable screen are far slower then not. Do some tests and you shall see. But then this is far slower then using sprites in my experiance.

Sprite collison is 'heavier' then using array collison although can look nicer.

To be no more, sad cure.

Login to post a reply

Server time is: 2024-05-17 05:14:34
Your offset time is: 2024-05-17 05:14:34