Advertisement
Guest User

xaintrailles

a guest
Apr 17th, 2014
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. OBJ_FIGHTBOX // EVENT Step
  2.  
  3. //afficher le fight_pad
  4. if (player1_turn = true and global.interrupt=0)
  5. {
  6. instance_create(1000,640,obj_pad_element5);
  7. instance_create(1000,637,obj_pad_element1);
  8. instance_create(1000,637,obj_pad_element2);
  9. instance_create(1000,640,obj_pad_element3);
  10. instance_create(1000,640,obj_pad_element4);
  11. }
  12.  
  13. if global.interrupt = 1 {  // si une boite de dialogue apparait         <--------  PROBLEM HERE I THINK
  14. if mouse_check_button_pressed(mb_left)
  15. // sur la boite de dialogue
  16. {
  17. if mouse_x>obj_texte.bbox_left && mouse_x<obj_texte.bbox_right &&
  18. mouse_y>obj_texte.bbox_top && mouse_y<obj_texte.bbox_bottom  
  19. { global.interrupt = 0 ;
  20. with(obj_texte){instance_destroy();}
  21. } } }
  22.  
  23. if global.interrupt = 0 {
  24. // test de la souris
  25. if mouse_check_button_pressed(mb_left)
  26. // bouton attaque
  27. { if mouse_x>obj_pad_element1.bbox_left && mouse_x<obj_pad_element1.bbox_right &&
  28. mouse_y>obj_pad_element1.bbox_top && mouse_y<obj_pad_element1.bbox_bottom  
  29. { player1_attack=true }
  30. else player1_turn=false; } ;
  31.  
  32.  
  33. // attaque déclenchée sur le fight_pad
  34. if (player1_turn = true and player1_attack =true )
  35. {
  36. player1_attackanim = true ;
  37. }
  38.  
  39. // attaque de l'ennemi 1
  40. if (enemy1_turn = true )
  41. {
  42. enemy1_attack = true ;
  43. }
  44. }
  45.  
  46. --------------------------------------------------------------------------------------
  47. --------------------------------------------------------------------------------------
  48. OBJ_FIGHTBOX // DRAW Step
  49. instance_create(x,y,obj_combat1);
  50. instance_create(436,524, obj_Cyrano) ;
  51.  
  52. // dessiner l'ennemi 1
  53. instance_create(734,390, obj_ennemi1) ;
  54.  
  55. draw_set_color(c_yellow);
  56. draw_set_font(fnt_Petit) ;
  57. draw_text(obj_ennemi1.x-35, obj_ennemi1.y+148, 'nom :' +string(enemy1_name)
  58. +'#HP: ' +string(enemy1_hp)
  59. +'#force : ' +string(enemy1_force)
  60. +'#vitesse : ' +string(enemy1_vitesse)  )  ;
  61. draw_text (50, 18, "room :"+string(room_get_name(room)))  ;
  62.  
  63.  
  64. if global.interrupt=0
  65. {
  66. // animation attaque joueur1
  67. if (player1_attackanim = true)
  68. {
  69. enemy1_hp -= player1_force ;
  70. draw_text(obj_ennemi1.x-20,obj_ennemi1.y-40, string(player1_force) +"DMG") ;
  71. player1_turn = false ;
  72. player1_attack = false ;
  73. player1_attackanim = false ;
  74. global.texte = "le joueur attaque !"
  75. instance_create(x,y,obj_texte ) ;
  76. global.interrupt=1 ;
  77. } ;
  78.  
  79.  
  80.  
  81. // animation attaque ennemi1
  82. if (enemy1_attack = true)
  83. {
  84. player1_hp -= enemy1_force ;
  85. draw_text(obj_ennemi1.x-20,obj_ennemi1.y-40, string(enemy1_force) +"DMG") ;
  86. enemy1_turn = false ;
  87. enemy1_attack = false ;
  88. tourdejeu += 1 ;
  89. } ;
  90. }
  91.  
  92.  
  93. draw_set_color(c_black);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement