Sprites Used:
GokuD
GokuR
GokuL
GokuU
GokuDS
GokuRS
GokuLS
GokuUS
Scripts:
//Put these into the scripts folder if not told elsewhere.
Hero_Script
global.current_hero = "Son_Goku";
//change the current_hero variable to whome you want.
//example, global.current_hero = "Son_Gohan";
global.movespeed = 3;
global.dir = "d";
global.can_move=true
global.moving=false
image_speed=0.18
global.hero_talk = false;
global.can_punch = true;
global.Hero_skills = 2;
global.ally_activate = false;
global.scene = 0
global.current_ally = "";
//set the ally variable to whome you want to have as a ally for example.
// globa.current_ally="Vegeta";
//The hero_skills variable is set to 2 so it can only use Ki Blast and
//the kamehameha wave.
// end comment.
check_hero_script
//Check hero script
// by Riku Nohara
//Created on September 23rd, 2007 at 12:05PM
//check the hero
if global.current_hero="Son_Goku" then
{
//check the direction
if global.dir="d" then
{
sprite_index = GokuD;
}
}
// Just do this for all your Characters!
//end Script
Object obj_hero
Create Event:
Call hero_script
Call_check_hero_script
Step Event:
//Log Movement Script
//By Riku Nohara
if global.can_move=true {
if global.current_hero="Son_Goku"
{
if (keyboard_check(vk_left)) x -= 2;
if (keyboard_check(vk_right)) x += 2;
if (keyboard_check(vk_up)) y -= 2;
if (keyboard_check(vk_down)) y += 2;
}
if keyboard_check(vk_left) {
global.dir="l"
}
if keyboard_check(vk_right) {
global.dir="r"
}
if keyboard_check(vk_down) {
global.dir="d"
}
if keyboard_check(vk_up) {
global.dir="u"
}
if keyboard_check(vk_left) && global.dir="l" {
if ! keyboard_check(vk_up) && ! keyboard_check(vk_down) {
if ! keyboard_check_released(vk_up) && ! keyboard_check_released(vk_down) {
vspeed=0
}
image_speed=0.18
sprite_index=GokuL
}
}
if keyboard_check(vk_right) && global.dir="r" {
if ! keyboard_check(vk_up) && ! keyboard_check(vk_down) {
if ! keyboard_check_released(vk_up) && ! keyboard_check_released(vk_down) {
vspeed=0
}
image_speed=0.18
sprite_index=GokuR
}
}
if keyboard_check(vk_down) && global.dir="d" {
if ! keyboard_check(vk_left) && ! keyboard_check(vk_right) {
if ! keyboard_check_released(vk_left) && ! keyboard_check_released(vk_right) {
hspeed=0
}
image_speed=0.18
sprite_index=GokuD
}
}
if keyboard_check(vk_up) && global.dir="u" {
if ! keyboard_check(vk_left) && ! keyboard_check(vk_right) {
if ! keyboard_check_released(vk_left) && ! keyboard_check_released(vk_right) {
hspeed=0
}
image_speed=0.18
sprite_index=GokuU
}
}
if keyboard_check(vk_down) && keyboard_check(vk_up) {
if keyboard_check(vk_up) && keyboard_check(vk_down) {
if global.dir="u" {
y -= 2;
}
}
}
if keyboard_check(vk_right) && keyboard_check(vk_left) {
if keyboard_check(vk_left) && keyboard_check(vk_right) {
if global.dir="r" {
x += 2;
}
}
}
}
No key Event:
image_speed=0
if global.dir="d" {
sprite_index=GokuDS
}
if global.dir="r" {
sprite_index=GokuRS
}
if global.dir="l" {
sprite_index=GokuLS
}
if global.dir="u" {
sprite_index=GokuLS
}
y -= 0;
y += 0;
x -= 0;
x += 0;
This Script simulates the Legecy of Goku Movement, it may look messy but that is only because I wanted it exactly like the games movement.
Enjoy!