Advertisement
Guest User

Untitled

a guest
Apr 20th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.94 KB | None | 0 0
  1. //bronze
  2. if (place_meeting(x,y,objItemPlacement)) {
  3. coinbronze = instance_nearest(x,y,objItemPlacement);
  4. with(coinbronze){
  5. if sprite_index = sprCoinBronze{
  6. instance_destroy();
  7. }
  8. if (global.mute_sounds == 1) audio_play_sound(global.soundbronze,5,0);
  9. global.l_coins += choose(1,2,3,4,5)
  10. }}
  11.  
  12. //silver
  13. if (place_meeting(x,y,objItemPlacement)) {
  14. coinsilver = instance_nearest(x,y,objItemPlacement);
  15. with(coinsilver){
  16. if sprite_index = sprCoinSilver{
  17. instance_destroy();
  18. }
  19. if (global.mute_sounds == 1) audio_play_sound(global.soundsilver,5,0);
  20. global.l_coins += choose(5,6,7,8,9,10)
  21. }}
  22.  
  23. //gold
  24. if (place_meeting(x,y,objItemPlacement)) {
  25. coingold = instance_nearest(x,y,objItemPlacement);
  26. with(coingold){
  27. if sprite_index = sprCoinGold{
  28. instance_destroy();
  29. }
  30. if (global.mute_sounds == 1) audio_play_sound(global.soundgold,5,0);
  31. global.l_coins += choose(11,12,13,14,15)
  32. }}
  33.  
  34. #endregion
  35.  
  36. #region Other code
  37. ///Star
  38. if (place_meeting(x,y,objItemPlacement)) {
  39. goldstar = instance_nearest(x,y,objItemPlacement);
  40. with(goldstar){
  41. if sprite_index = sprStar{
  42. instance_destroy();
  43. }
  44. if (global.mute_sounds == 1) audio_play_sound(sndGainLifeSound,5,0);
  45. if (global.l_star < 3) global.l_star +=1;
  46. }
  47. }
  48.  
  49. ///Health
  50. if (place_meeting(x,y,objItemPlacement)) {
  51. playerheart = instance_nearest(x,y,objItemPlacement);
  52. with(playerheart){
  53. if sprite_index = sprHealth{
  54. instance_destroy();
  55. }
  56. if (global.mute_sounds == 1) audio_play_sound(sndGainLifeSound,5,0);
  57. if (global.l_health < global.l_healthmax) global.l_health +=25;
  58.  
  59. }}
  60.  
  61. ///Lives
  62. if (place_meeting(x,y,objItemPlacement)) {
  63. playerlife = instance_nearest(x,y,objItemPlacement);
  64. with(playerlife){
  65. if sprite_index = sprLife{
  66. instance_destroy();
  67. }
  68. if (global.mute_sounds == 1) audio_play_sound(sndGainLifeSound,5,0);
  69. if (global.l_lives < 3) global.l_lives +=1;
  70. }
  71. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement