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 Camera scroll

Author
Message
NekoMD
20
Years of Service
User Offline
Joined: 21st Feb 2006
Location:
Posted: 7th Mar 2006 02:38
Hi!!!! My last post was answered poorly by only one person, this means that there's no one here who knows how to use 2d camera?????
The only answer was: move the map so you get the feeling of scrolling, but what about the other objects in screen??? I tried and tried but no one ever explained at least an idea, please if someone knows something about the subject let me know...thanks a lot!!!
Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 8th Mar 2006 05:51
The other objects should move along with the map or rather a part of it using a multi-layered map.

dim Map(500,500,3)

Layer 3 = Bad guys
Layer 2 = Items (anything that's "picked up" by the player)
Layer 1 = Unmovable objects (walls)
Layer 0 = Ground tiles


Ian Price
20
Years of Service
User Offline
Joined: 4th Mar 2006
Location:
Posted: 8th Mar 2006 14:51
You need to add an offset variable to the position of the map image and the object images. When you want to scroll just increase/decrease the offest values and everything should move together. ie -

Draw map, x+offset,y
Draw object, x+offset,y

This can create additional problems with regards to collision detection and such (just remember to take away the offset value when true positions are required. However, it can work well.

Old's cool
Scraggle
Moderator
22
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 8th Mar 2006 15:51
I could give you all the help you need, but since it was me that helped you last time and you have just told everyone how poor my advice was, then I suggest you read a book!

If you are going to slag off the people that offer help, don't expect anyone to be willing to offer it.

The answer I gave you was admittedly concise but it was absolutely correct.


Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 8th Mar 2006 20:21
Scraggle, I know how you feel... I ran into a guy like NekoMD yesterday.

NekoMD, Scraggle is totally right. 99% of the games out there have the main character in the center and the world moves... not them.


Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 8th Mar 2006 23:44
Well I think that sprites are stuck with screen coordinates, so the camera does not scroll them, unless DBPro is different in that way to DB Classic. So you just scroll the sprites in the opposite direction to the camera, at the same speed, and distance.

NekoMD
20
Years of Service
User Offline
Joined: 21st Feb 2006
Location:
Posted: 9th Mar 2006 17:55
Thanks you all for taking the time, your advice was really useful!! I want to say sorry to Scraggle, I know I was wrong about your advice, the thing is that I was soooooo frustrated that I did NOT recognize when someone wants to help, so SCRAGGLE PLEASE FORGIVE ME!!!!!!! thankkksss!!!!

Login to post a reply

Server time is: 2026-07-02 03:29:29
Your offset time is: 2026-07-02 03:29:29