Search Picceta.com
 Posted by MysticTrunks | 7:13 am on July 29, 2008 - 1 Star2 Stars3 Stars4 Stars5 Stars

This is an exact replica of the LOG movement script, even though the script itself was from LEGACY code which means they got it from a database. Zelda has the same script, though that script was modified for the environment, log’s wasn’t.

Create Event

dir = “d”;
movespeed = 2;
attacking = false;
can_move = true;
ani_speed = 0.18;
moving = 0;

Step Event

//Game Boy Advance Movement Script
//Written on February 22, 2008
//By MysticTrunks

//set keys
if keyboard_check(vk_right) { moving=1 }
if keyboard_check(vk_down) { moving=1 }
if keyboard_check(vk_left) { moving=1 }
if keyboard_check(vk_up) { moving=1 }

if keyboard_check(vk_right) { x +=movespeed }
if keyboard_check(vk_down) { y +=movespeed }
if keyboard_check(vk_left) { x -=movespeed }
if keyboard_check(vk_up) { y -=movespeed }

//set direction
if keyboard_check(vk_down) ||keyboard_check(vk_up) || keyboard_check(vk_left) || keyboard_check(vk_right) {
if !moving {
if keyboard_check(vk_down) { dir=”d” }
if keyboard_check(vk_up) { dir=”u” }
if keyboard_check(vk_left) { dir=”l” }
if keyboard_check(vk_right) { dir=”r” }
}
//Fixed Direction
if (keyboard_check(vk_down) && !keyboard_check(vk_left) && !keyboard_check(vk_right)) { dir=”d” }
    else if (keyboard_check(vk_up) && !keyboard_check(vk_left) && !keyboard_check(vk_right)) { dir=”u” }
    else if (keyboard_check(vk_left) && !keyboard_check(vk_down) && !keyboard_check(vk_up)) { dir=”l” }
    else if (keyboard_check(vk_right) && !keyboard_check(vk_down) && !keyboard_check(vk_up)) { dir=”r”}
} else { moving=0 }

//GBA Movement
if keyboard_check(vk_up) && keyboard_check(vk_down)
{
dir = “u”
y-=movespeed;
}

if keyboard_check(vk_left) && keyboard_check(vk_right)
{
dir = “l”
x-=movespeed;
}

//handle sprites
if moving=1 {
{    
   switch dir {
            case “d”: sprite_index=spr_goku_d; break;
            case “u”: sprite_index=spr_goku_u; break;
            case “l”: sprite_index=spr_goku_l; break;
            case “r”: sprite_index=spr_goku_r; break;
        }
        image_speed=ani_speed
}
}
//let’s stand
if moving=0 {
{      
    switch dir {
         case “d”: sprite_index=spr_goku_s_d; break;
         case “u”: sprite_index=spr_goku_s_u; break;
         case “l”: sprite_index=spr_goku_s_l; break;
         case “r”: sprite_index=spr_goku_s_r; break;

    }
}
// the great depth function
depth=-y
}

ENJOY!

 
1 Comment

anyone like it?

Comment by MysticTrunks — July 30, 2008 @ 3:41 pm
Leave a comment:You must be logged in to post a comment.
  • Lesson 2 : Variables
  • Lesson 1 : Getting to know Game Maker
  • How to Icon on Byond
  • Switch Tutorial
  • Platformer$ Guide 99
  • DeM0nFiRe’s Advanced Cutscenes
  • Legacy of Goku Movement
  • Introduction into Rm2k3
  • Ki Blast - Adventure Battle System
  • Adventure Battle System Punching