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.

Simple easy script

I've looked everywhere, but I can't find the basic 8 way movement script. The one's I find have extra frames, mouse input, axel based movement, but I can't find the simplest of scripts. It's not in the directories, it's no-where.
Someone post it please?
I think it's an edit on game_player
It can't be SDk for compatibility
 
This is a simple SDK version
Code:
class Game_Player
  MOVE_METHOD = {1 => 'move_lower_left',
                 2 => 'move_down',
                 3 => 'move_lower_right',
                 4 => 'move_left',
                 6 => 'move_right',
                 7 => 'move_upper_left',
                 8 => 'move_up',
                 9 => 'move_upper_right'}
  def update_player_movement
    eval(MOVE_METHOD[Input.dir8])
  end
end
 
el felixio;186707 said:
I think it's an edit on game_player
You're right. Look for those lines in Game_Player
Code:
      case Input.dir4
      when 2
        move_down
      when 4
        move_left
      when 6
        move_right
      when 8
        move_up
      end
and replace it for (I've highlighted what I changed)
Code:
      case Input.[COLOR=Red]dir8[/COLOR]
[COLOR=Red]      when 1
        move_lower_left[/COLOR]
      when 2
        move_down
[COLOR=Red]      when 3
        move_lower_right[/COLOR]
      when 4
        move_left
      when 6
        move_right
[COLOR=Red]      when 7
        move_upper_left[/COLOR]
      when 8
        move_up
[COLOR=Red]      when 9
        move_upper_right[/COLOR]
      end
 

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