• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Need Help Creating Playable Character

S

Skygames Jay

Guest
Hi, I'm new to the GameMaker Community. I'm trying to figure out the code that would be needed for a whole up, down, left, and right arrow character movement, like in The Legend of Zelda RPG games. I have also ran into a stump trying to figure out the GML code basics. Its a weird shift from Notepad .bat files to full on X,Y movement with separate rooms. Thx :)
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
No problems! It's easier to point you to resources like this than try to explain everything from scratch ourselves... but if you have any questions as you learn, or you have any issues putting what you learn into practice, don't hesitate to post again and request help!
 
R

Rusty

Guest
I don't see why he'd need a tutorial for such basic movement.

It's very simple really. You just need to use keyboard_check to check the keys and then move the character in that direction along the X and Y coords.

Using keyboard_check:
if keyboard_check(vk_up)//(ord("W') is used for WASD controls here
{ target_y+=16;}
if target_y>y {y+=4;}

That simple code will move the character northwards. From there you can define things to better suit your game, such as making it so the player moves on an invisible grid (which can be done by adding a check to see if target_y=y and target_x=x) or checking to make sure other keys aren't being pressed. It is really simple though, just take it and go experiment with it and if you run into any problems with it we'll be here to answer any questions you might have.
 
A

Aura

Guest
I don't see why he'd need a tutorial for such basic movement.
Consulting a tutorial should be the first step of learning how certain game mechanics work IMO; makes you much more self-dependent and is way faster than using a forum. Save forums for issues with the mechanics, leave their implementation process to the tutorials (if available).
 
Top