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.

Characters going off the map

Right when I'm using some coding to make you walk in all 9 directions you can occasionaly walk off the map when you go diagonally.

Well this is kinda RGSS help in 2 ways.

First - Why does this happen and how could I stop it?


Second - How does this happen and could I make it so you can walk off the map and go round it (maybe for test games) ?



Thanks
Syvkal
 
Nine directions? I think you mean eight.

Your first question entirely depends upon the sctipt that you're using.

For your second question... you can't really but I don't see why you'd want to. The only way you could is to make the map bigger but have the screen move as if the dimensions were smaller... but that's so much of a hassle it's not worth it, and again, I don't see why you'd need it.
 
Yeah I did mean 8, but the ninth direction is up (eg. jumping).

All I've done for 8 directions is change this in Game_Player:
Code:
      case Input.dir4
      when 2
        move_down
      when 4
        move_left
      when 6
        move_right
      when 8
        move_up
      end
To this:
Code:
      case Input.dir8 
      when 2 
        move_down 
      when 4 
        move_left 
      when 6 
        move_right 
      when 8 
        move_up 
      when 7 
        move_upper_left 
      when 9 
        move_upper_right 
      when 3 
        move_lower_right 
      when 1 
        move_lower_left 
      end

Is there anything wrong in that scripting?
 

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