GameMaker: Studio

GameMaker: Studio

View Stats:
Terribilis 26 Oct, 2024 @ 11:07am
My character won't move
i recently want to start learning how to make game, so i listen to the offical youtube tutorial and try to make my character to move, but it's just won't budge. can someone help?

create:
window_set_size(1280,720);
xsp=0;
ysp=0;

step:
if keyboard_check(ord("D"))
{
xsp+=1;
}
if keyboard_check(ord("A"))
{
xsp-=1;
}
if keyboard_check(ord("S"))
{
ysp+=1;
}
if keyboard_check(ord("W"))
{
ysp-=1;
}
< >
Showing 1-5 of 5 comments
Blind 26 Oct, 2024 @ 11:42am 
did you bind xsp and ysp to anything such as, like, hspeed or vpseed?
Terribilis 27 Oct, 2024 @ 7:19am 
no. so i can't really set a variable as to moving speed huh? i will try it and report the result
Blind 27 Oct, 2024 @ 8:14am 
Originally posted by Terribilis:
no. so i can't really set a variable as to moving speed huh? i will try it and report the result

you can, you just... didn't yet.

you'd need to do something like "xspeed=xsp" or some equivalent
The Winter Bud 27 Oct, 2024 @ 2:22pm 
xsp and ysp are just a variables. They don't do anything but hold a value. You need to do something with that values. You can assign them to x and y and move the object manually or you can assign them to hspeed and vspeed to move it automatically. You could also come up with an algorithm to translate your xsp and ysp into a direction and a speed and assign it to direction and speed respectively.

https://manual.gamemaker.io/lts/en/GameMaker_Language/GML_Reference/Movement_And_Collisions/Movement/Movement.htm
Last edited by The Winter Bud; 28 Oct, 2024 @ 8:39am
Terribilis 29 Oct, 2024 @ 4:19am 
i see. it all work out now, thanks for your helps
< >
Showing 1-5 of 5 comments
Per page: 1530 50