简体   繁体   中英

Scrolling screen to the right GameMaker

view_xview += 1

I'm trying to make my screen constantly scroll, but it's not moving.

As far as I'm aware you just make an invisible object on your screen and assign this as a step event to it? I've also heard to make the camera follow an invisible object moving on the screen but this seems better surely?

I've enabled my use of views, enabled it to be seen, I've tried

view_xview += 1 and view_xview[0] += 1 because I've seen both, I'm definitely on view0.

The easiest way to do this is to make an object that's invisible but still has a sprite, and just give it an hspeed of 1, then have the view follow it. Create it a bit before the horizontal follow border so that the player can get their bearings before the screen starts moving.

Where are you placed view_xview[0] += 1 ? What event? Step? And Object following must be <no object> .

So, all steps must be:

  1. Create object obj_controller
  2. Add event Step , place code: view_xview[0] += 1;
  3. Create room
  4. Place obj_controller to the room
  5. Enable views in the room ( Enable the use of Views in the Views tab)
  6. Set Visible when room starts for View 0
  7. Define size/port of the view

Also set Use synchronization to avoid tearing in Global Game Settings -> Windows -> Graphics

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM