]> vgcfreebox.myrthtech.pt Git - gm-duelo.git/blob - objects/obj_player/Step_1.gml
player object
[gm-duelo.git] / objects / obj_player / Step_1.gml
1 /// @description check user inputs
2 var _input = rollback_get_input();
3
4 //keyboard inputs
5 // movement
6 if(_input.right){
7 _right = 1;
8 }else{ _right = 0;}
9 if(_input.left){
10 _left = 1;
11 }else{ _left = 0;}
12 if(_input.up){
13 _up = 1;
14 }else{ _up = 0;}
15 if(_input.down){
16 _down = 1;
17 }else{ _down = 0;}
18
19 // action
20 if(_input.z and not _input.x){
21 _melee_atk = 1;
22 }else{ _melee_atk = 0;}
23 if(_input.x and not _input.z){
24 _range_atk = 1;
25 }else{ _range_atk = 0;}
26 if(_input.c){
27 _evasion = 1;
28 }else{ _evasion = 0;}
29
30 if(_input.space){
31 _special = 1;
32 }else{ _special = 0;}
33
34
35 // face direction
36 if(_state != HERO.DEAD){
37 if _left = 1 image_xscale = -1;
38 if _right = 1 image_xscale = 1;
39 }