4
0
Fork 0
This repository has been archived on 2023-09-15. You can view files and clone it, but cannot push or open issues or pull requests.
surprise_dungeon/objects/oPlayer/Step_0.gml

27 lines
732 B
Plaintext
Raw Normal View History

2020-12-04 21:55:36 +00:00
keyLeft = keyboard_check(vk_left) or keyboard_check(ord("Q"));
2020-12-05 11:48:37 +00:00
keyRight = keyboard_check(vk_right) or keyboard_check(ord("D"));
keyUp = keyboard_check(vk_up) or keyboard_check(ord("Z"));
keyDown = keyboard_check(vk_down) or keyboard_check(ord("S"));
2020-12-04 22:00:11 +00:00
keyAttack = keyboard_check_pressed(vk_shift);
2020-12-05 11:48:37 +00:00
// Déplacement du joueur
2020-12-04 22:09:24 +00:00
deplaceHorizontal = keyRight - keyLeft;
deplaceVertical = keyDown - keyUp;
x += deplaceHorizontal;
2020-12-05 11:48:37 +00:00
y += deplaceVertical;
seDeplace = (deplaceHorizontal != 0 or deplaceVertical != 0);
// Animation des sprites
if (seDeplace) {
2020-12-05 13:27:37 +00:00
if (deplaceHorizontal = 0) {
if (deplaceVertical = 1) image_index = 0;
else image_index = 2;
}
else if (deplaceHorizontal = 1) image_index = 1;
else image_index = 3;
2020-12-05 11:48:37 +00:00
}