GML Visual Help with Character movement

J

JTPixelOwl

Guest
So, I am very new to Gms2 and i am trying to make my character move using North, Northwest, West, Etc. Variables that change to 1 when the corresponding keys are pressed. However its not doing anything when i press the A key (which is what i'm starting off with). Any suggestions? Below is what i have right now.
2017-09-10_2042.png
 
T

Turrican

Guest
Hi, I advice you to start programming with codes, for the movement you can find a lots of tutorial on youtube.
 
J

JTPixelOwl

Guest
Hi, I advice you to start programming with codes, for the movement you can find a lots of tutorial on youtube.
Here is the converted code, And thanks for the help!



/// @DnDAction : YoYo Games.Common.Variable
/// @DnDVersion : 1
/// @DnDHash : 20086955
/// @DnDInput : 2
/// @DnDArgument : "var" "West_walk"
/// @DnDArgument : "var_1" "NWest_walk"
West_walk = 0;
NWest_walk = 0;
/// @DnDAction : YoYo Games.Common.If_Variable
/// @DnDVersion : 1
/// @DnDHash : 687A207C
/// @DnDArgument : "var" "West_walk"
/// @DnDArgument : "value" "1"
if(West_walk == 1)
{
/// @DnDAction : YoYo Games.Instances.Set_Sprite
/// @DnDVersion : 1
/// @DnDHash : 0A170249
/// @DnDParent : 687A207C
/// @DnDArgument : "imageind_relative" "1"
/// @DnDArgument : "spriteind" "sprite9"
/// @DnDSaveInfo : "spriteind" "78ef75af-90a2-470f-9521-9aeb86c6e169"
sprite_index = sprite9;
image_index += 0;
/// @DnDAction : YoYo Games.Movement.Jump_To_Point
/// @DnDVersion : 1
/// @DnDHash : 3B04CC4B
/// @DnDParent : 687A207C
/// @DnDArgument : "y" "-6"
/// @DnDArgument : "y_relative" "1"
y += -6;
}
/// @DnDAction : YoYo Games.Common.If_Variable
/// @DnDVersion : 1
/// @DnDHash : 5473F2E0
/// @DnDArgument : "var" "NWest_walk"
/// @DnDArgument : "value" "1"
if(NWest_walk == 1)
{
/// @DnDAction : YoYo Games.Instances.Set_Sprite
/// @DnDVersion : 1
/// @DnDHash : 5219AA2A
/// @DnDParent : 5473F2E0
/// @DnDArgument : "imageind_relative" "1"
/// @DnDArgument : "spriteind" "sprite23"
/// @DnDSaveInfo : "spriteind" "ed34780c-bf94-4437-a8f9-636a0a2073c4"
sprite_index = sprite23;
image_index += 0;
/// @DnDAction : YoYo Games.Movement.Jump_To_Point
/// @DnDVersion : 1
/// @DnDHash : 2CE3E9CC
/// @DnDParent : 5473F2E0
/// @DnDArgument : "x" "-3"
/// @DnDArgument : "x_relative" "1"
/// @DnDArgument : "y" "3"
/// @DnDArgument : "y_relative" "1"
x += -3;
y += 3;
}
/// @DnDAction : YoYo Games.Mouse & Keyboard.If_Key_Down
/// @DnDVersion : 1
/// @DnDHash : 5EBC0793
/// @DnDArgument : "key" "ord("W")"
var l5EBC0793_0;
l5EBC0793_0 = keyboard_check(ord("W"));
if (l5EBC0793_0)
{
/// @DnDAction : YoYo Games.Common.Variable
/// @DnDVersion : 1
/// @DnDHash : 5A8FC7FC
/// @DnDParent : 5EBC0793
/// @DnDArgument : "expr" "1"
/// @DnDArgument : "expr_relative" "1"
/// @DnDArgument : "var" "NWest_walk"
NWest_walk += 1;
}
/// @DnDAction : YoYo Games.Mouse & Keyboard.If_Key_Down
/// @DnDVersion : 1
/// @DnDHash : 2D75C237
/// @DnDArgument : "key" "ord("A")"
var l2D75C237_0;
l2D75C237_0 = keyboard_check(ord("A"));
if (l2D75C237_0)
{
/// @DnDAction : YoYo Games.Common.Variable
/// @DnDVersion : 1
/// @DnDHash : 3A929F3F
/// @DnDParent : 2D75C237
/// @DnDArgument : "expr" "1"
/// @DnDArgument : "var" "West_walk"
West_walk = 1;
}
 
J

JTPixelOwl

Guest
Hi, I advice you to start programming with codes, for the movement you can find a lots of tutorial on youtube.
I'm horrible with GML, But if I cant figure out how to fix it, Ill try that.
 

jazzzar

Member
I'm horrible with GML, But if I cant figure out how to fix it, Ill try that.
thought the same when I started using game maker years ago, always put myself down saying gml is hard, and now it's the easiest thing, invest your time learning it, it will become easy with time!
 
Top