Save-Point
8 Directions Movement - Printable Version

+- Save-Point (https://www.save-point.org)
+-- Forum: Archives (https://www.save-point.org/forum-105.html)
+--- Forum: Creation Asylum Archives (https://www.save-point.org/forum-90.html)
+---- Forum: Scripts & Code Snippets (https://www.save-point.org/forum-92.html)
+----- Forum: RPG Maker XP Code (https://www.save-point.org/forum-93.html)
+------ Forum: Enhancement/Modification Scripts (https://www.save-point.org/forum-98.html)
+------ Thread: 8 Directions Movement (/thread-6482.html)



8 Directions Movement - Dubealex - 02-13-2005

8 Directions Movement for the player:
by Dubealex
Feb 13, 2005

This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given. If you are the owner of the thread, please contact administration.


Go in game_player, and find the line:

Code:
def update

(Around line #204)

Then you will see that code neat below that line:

Code:
case Input.dir4
      when 2
        move_down
      when 4
        move_left
      when 6
        move_right
      when 8
        move_up
    end

Replace that block of code by the following:

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

And you are done.