I Have a Question

I’m using GM myself and need to know, what’s the code for scrolling. Like where the camera keeps up with you in an oversized room.

That’s a question to ask on a GameMaker forum. I think it should be either explained thoroughly in a tutorial, or built-in, though… it’s kind of an important part of any 2D game.
EDIT: Oh shit I just minimodded. Oops. <_>

I would just move this to the fangames board, but since there’s a topic for these kinds of questions, I’ll just leave it here and lock it.

But I’ll answer it first, of course. >_>

A camera system is built right into Game Maker. Open up a room’s settings and go to the “views” tab. Check “Enable the use of views”, select a view number (probably just stick with View 0), and check “Visible when room starts”. Then enter in the info below that for the view.

For your camera, you’ll probably leave all of the X’s and Y’s as 0 and set all of the W’s and H’s as the width and height of your game’s window, probably 640 x 480 or something else with a 4:3 ratio. (It would probably be the current width and height of your room under the settings tab).

Then choose the object you want the camera to follow, presumably whatever the player controls. Hbor and Vbor indicate how close to the edges of the screen that object can go before the camera starts scrolling (bor = border), and Hsp and Vsp indicate the speed of the camera in pixels per step (set them to -1 and the player will always be on the screen).

Then you can set the room’s width and height under the settings tab to anything you want without affecting the game’s window size. But you’ll have to do this for every room. :wink:

If you have any more questions, you can ask them in this topic.