Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Map Scrolling

I just recently read up on Ruby, learned how it functions, etc, so that I can jump right in and do something with RMXP. So, my first task was to create a variable that displays on screen. Got that alright. My second, more ambitious task was to do map scrolling.

Having messed around enough, the map no longer stops at the edge of itself, instead, it shows what's on the opposite side of the map. Okay, so that was actually easy to do. Then I recoded the valid? and... hell, I forget now. The 2 things that checked if the square you're moving to was valid, and passable, or something. I changed a bunch, and forgot now. The point is, it now checks the opposite value on the edge of the screen (so $game_map.width-1 for moving left, etc), and will "let" you move there if it's okay. Of course, I then had to add code to the move_left, etc bits so that if @x < 0, or > $game_map.width, to put it at the opposite side of the screen.

Now... amusingly, when the code ran, it worked... but 2 problems emerged. #1 is obvious; the events on the opposite side of the screen just don't show up offscreen, where it repeats. I'm sure I could fix that... somehow. #2: redefining @x and/or @y makes the character move... instead of just "appear" where the new @x and @y values are. That's because of the code that's all up ins the update/refresh thing, right? I'm sure I can redefine that somehow...



Anyway, my short, very easy question is, and was; Has anyone actually successfully coded map scrolling (like was available on RM2K)?
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top