Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- OBJ_FIGHTBOX // EVENT Step
- //afficher le fight_pad
- if (player1_turn = true and global.interrupt=0)
- {
- instance_create(1000,640,obj_pad_element5);
- instance_create(1000,637,obj_pad_element1);
- instance_create(1000,637,obj_pad_element2);
- instance_create(1000,640,obj_pad_element3);
- instance_create(1000,640,obj_pad_element4);
- }
- if global.interrupt = 1 { // si une boite de dialogue apparait <-------- PROBLEM HERE I THINK
- if mouse_check_button_pressed(mb_left)
- // sur la boite de dialogue
- {
- if mouse_x>obj_texte.bbox_left && mouse_x<obj_texte.bbox_right &&
- mouse_y>obj_texte.bbox_top && mouse_y<obj_texte.bbox_bottom
- { global.interrupt = 0 ;
- with(obj_texte){instance_destroy();}
- } } }
- if global.interrupt = 0 {
- // test de la souris
- if mouse_check_button_pressed(mb_left)
- // bouton attaque
- { if mouse_x>obj_pad_element1.bbox_left && mouse_x<obj_pad_element1.bbox_right &&
- mouse_y>obj_pad_element1.bbox_top && mouse_y<obj_pad_element1.bbox_bottom
- { player1_attack=true }
- else player1_turn=false; } ;
- // attaque déclenchée sur le fight_pad
- if (player1_turn = true and player1_attack =true )
- {
- player1_attackanim = true ;
- }
- // attaque de l'ennemi 1
- if (enemy1_turn = true )
- {
- enemy1_attack = true ;
- }
- }
- --------------------------------------------------------------------------------------
- --------------------------------------------------------------------------------------
- OBJ_FIGHTBOX // DRAW Step
- instance_create(x,y,obj_combat1);
- instance_create(436,524, obj_Cyrano) ;
- // dessiner l'ennemi 1
- instance_create(734,390, obj_ennemi1) ;
- draw_set_color(c_yellow);
- draw_set_font(fnt_Petit) ;
- draw_text(obj_ennemi1.x-35, obj_ennemi1.y+148, 'nom :' +string(enemy1_name)
- +'#HP: ' +string(enemy1_hp)
- +'#force : ' +string(enemy1_force)
- +'#vitesse : ' +string(enemy1_vitesse) ) ;
- draw_text (50, 18, "room :"+string(room_get_name(room))) ;
- if global.interrupt=0
- {
- // animation attaque joueur1
- if (player1_attackanim = true)
- {
- enemy1_hp -= player1_force ;
- draw_text(obj_ennemi1.x-20,obj_ennemi1.y-40, string(player1_force) +"DMG") ;
- player1_turn = false ;
- player1_attack = false ;
- player1_attackanim = false ;
- global.texte = "le joueur attaque !"
- instance_create(x,y,obj_texte ) ;
- global.interrupt=1 ;
- } ;
- // animation attaque ennemi1
- if (enemy1_attack = true)
- {
- player1_hp -= enemy1_force ;
- draw_text(obj_ennemi1.x-20,obj_ennemi1.y-40, string(enemy1_force) +"DMG") ;
- enemy1_turn = false ;
- enemy1_attack = false ;
- tourdejeu += 1 ;
- } ;
- }
- draw_set_color(c_black);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement