Main Menu
  • Welcome to The RPG Maker Resource Kit.

8 directions movement

Started by phillip1756, October 25, 2009, 10:13:12 AM

0 Members and 1 Guest are viewing this topic.

phillip1756

go into game_player and find this line

def update
it is around line #204

you should see this code below that line.

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


replace that block with the following

case Input.dir4
                 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 finally,you have 8 direction movement
no

By Kraft

tSwitch

move_upper_left does work and such, but the script itself does not.


FCF3a A+ C- D H- M P+ R T W- Z- Sf RLCT a cmn+++ d++ e++ f h+++ iw+++ j+ p sf+
Follow my project: MBlok | Find me on: Bandcamp | Twitter | Patreon

modern algebra

Well, it would work if Input.dir4 was replaced with Input.dir8


8D movement is very simple (other scripts are long because they try to allow for 8D sprites and they also put in pixel movement so that the time taken to move upper right is longer than to move up or right, because otherwise it doesn't make sense); I doubt he'd have to copy it from a script to get that, and even if he had it wouldn't matter because it's too minor and it wouldn't make any sense to do it any other way.

You people are such negative nancies :P

Lazer Ki

Yeah, if it says that there is only 4 directions, but you input 8, you will get an error.
Hi

tSwitch



FCF3a A+ C- D H- M P+ R T W- Z- Sf RLCT a cmn+++ d++ e++ f h+++ iw+++ j+ p sf+
Follow my project: MBlok | Find me on: Bandcamp | Twitter | Patreon