]> vgcfreebox.myrthtech.pt Git - gm-duelo.git/blob - objects/obj_player/Other_12.gml
player object
[gm-duelo.git] / objects / obj_player / Other_12.gml
1 /// @description JUMP
2 sprite_index = asset_get_index(string(_my_spr_jump));
3 _hsp = (_right - _left) * _speed;
4 if(image_index > 2){
5 image_speed = 0;
6 }
7
8 if(_hsp!=0 and place_meeting(x+_hsp,y,obj_wall)){
9 //image_index = 0;
10 _state = HERO.WALL;
11 }
12
13 if(_vsp = 0 and place_meeting(x,y+sprite_get_bbox_bottom(sprite_index),obj_wall)){
14 _state = HERO.IDLE;
15 }
16
17 if(_melee_atk and alarm[1] = -1){
18 image_index = 0;
19 alarm[1] = 2 * _attack_timer;
20 _state = HERO.ATTACK;
21 }
22
23 if(_range_atk){
24 image_index = 0;
25 _state = HERO.SHOOT;
26 }