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! / RPG Mapping (Top View)

Author
Message
Hunter
20
Years of Service
User Offline
Joined: 10th Oct 2003
Location:
Posted: 20th Oct 2003 12:15
How do I get the camera to focus on the character so that the map moves along instead of the character going off screen?
Pincho Paxton
21
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 20th Oct 2003 14:08
Move the camera x/y with the player X/Y. He he I'm a pain for making you work out the code, but it's the best way to learn.
Hunter
20
Years of Service
User Offline
Joined: 10th Oct 2003
Location:
Posted: 20th Oct 2003 15:23
Hmm... I tried that once before posting this... I wonder why it did not work...
Pincho Paxton
21
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 20th Oct 2003 16:39 Edited at: 20th Oct 2003 16:41
Well, if you're using a bitmap then the camera will not work at all. Forget about cameras for bitmaps you don't have any. If you've locked things to the screen then you will have to unlock them again. But I reckon that you are using a bitmap....

The bitmap method is...

sx=scrollX
sy=scrollY



Copy bitmap 1,X+sx,Y+sy,width+sx,height+sy,0,0,0,screen width,screen height.

By moving the X/Y you move the screen.

That's just part of the code! Hopefully you are already drawing a map or something on screen 1.

Adjust as required.

Pincho.

Login to post a reply

Server time is: 2024-04-27 16:54:43
Your offset time is: 2024-04-27 16:54:43