1 if(_game_state = GAME_STATES.WAITING){
2 if(object_exists(obj_game_controller)){
3 if(_up or _down or _left or _right or _melee_atk or _range_atk){
4 if player_id == 0 obj_game_controller._p1_ready = true;
5 if player_id == 1 obj_game_controller._p2_ready = true;
10 if(_game_state = GAME_STATES.HERO_SELECTION){
11 var _max_char = array_length(global._characters)-1;
12 if(_right and alarm[0] = -1 and _selected_char == noone){_char_select_index++; alarm[0] = room_speed/4}
13 if(_left and alarm[0] = -1 and _selected_char == noone){_char_select_index--; alarm[0] = room_speed/4}
14 if(player_id == 0){ // for debug
15 if(_up and alarm[0] = -1){obj_game_controller._scenary_selected_index++; alarm[0] = room_speed/4}
16 if(_down and alarm[0] = -1){obj_game_controller._scenary_selected_index--; alarm[0] = room_speed/4}
18 if _char_select_index < 0 _char_select_index = _max_char;
19 if _char_select_index > _max_char _char_select_index = 0;
21 if _melee_atk and player_id == 0 {
22 _selected_char = global._characters[_char_select_index];
23 obj_game_controller._p1_selected_char = _selected_char;
24 fetch_my_attr(_selected_char);
25 }else if _melee_atk and player_id == 1 {
26 _selected_char = global._characters[_char_select_index];
27 obj_game_controller._p2_selected_char = _selected_char;
28 fetch_my_attr(_selected_char); // to remove
30 if(_range_atk and _selected_char != noone){
31 _selected_char = noone;
32 if player_id == 0 obj_game_controller._p1_selected_char = noone;
33 if player_id == 1 obj_game_controller._p2_selected_char = noone;
35 if( _special and player_id == 0 ){
36 _to_clear_my_data = get_string_async("Writte YES to clear your data","NO");
40 if(_game_state = GAME_STATES.FIGHTING){
41 if _health <= 0 _state = HERO.DEAD;
42 if player_id == 0 obj_game_controller._p1_hp = _health;
43 if player_id == 1 obj_game_controller._p2_hp = _health;
81 if _state != HERO.WALL _vsp += _grav; else _vsp = _wall_drag;
82 obj_wall_collisions();
86 var _val = animcurve_channel_evaluate(_hit_blink, _hit_bk_val);
88 if _hit_bk_val > 1 _hit_bk_val = 0;else _hit_bk_val+=0.1;
89 }else{image_alpha = 1;}