GameMaker: Studio

GameMaker: Studio

Lihat Statistik:
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;
}
< >
Menampilkan 1-5 dari 5 komentar
Blind 26 Okt 2024 @ 11:42am 
did you bind xsp and ysp to anything such as, like, hspeed or vpseed?
Terribilis 27 Okt 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 Okt 2024 @ 8:14am 
Diposting pertama kali oleh 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
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
Terakhir diedit oleh The Winter Bud; 28 Okt 2024 @ 8:39am
Terribilis 29 Okt 2024 @ 4:19am 
i see. it all work out now, thanks for your helps
< >
Menampilkan 1-5 dari 5 komentar
Per halaman: 1530 50