Advertisement
Guest User

Untitled

a guest
Nov 19th, 2019
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. int sleepy = 0;
  2. int thirst = 0;
  3. int hunger = 0;
  4. int whisky = 0;
  5. int gold = 0;
  6.  
  7. void setup()
  8. {
  9. size (500,600);
  10. background(0);
  11. textSize(25);
  12.  
  13.  
  14. for(int i = 0;i < 1000; i++){
  15. clear();
  16. text("Sleepy = " + sleepy,180,100);
  17. text("Thirst = " + thirst,180,150);
  18. text("Hunger = " + hunger,180,200);
  19. text("Whisky = " + whisky,180,250);
  20. text("Gold = " + gold,180,300);
  21.  
  22. text("i = " + i,180,500);
  23.  
  24.  
  25. if(thirst >= 95 && whisky == 0){
  26. Shop4whisky();
  27. }
  28. else if(whisky == 1){
  29. Drink();
  30. }
  31. else if(hunger >= 90){
  32. Eat();
  33. }
  34. else if(sleepy >= 85){
  35. Sleeping();
  36. }
  37. else {
  38. Mining();
  39. }
  40.  
  41. if(sleepy > 100 || sleepy < 0 || thirst > 100 || thirst < 0 || hunger > 100 || hunger < 0 || whisky >= 10 || whisky < 0 || gold < 0)
  42. {
  43. text("død",180,400);
  44. break;
  45. }
  46. }
  47. }
  48.  
  49.  
  50. public void Sleeping()
  51. {
  52. sleepy -= 10;
  53. thirst += 1;
  54. hunger += 1;
  55. whisky += 0;
  56. gold += 0;
  57. }
  58.  
  59. public void Mining()
  60. {
  61. sleepy += 5;
  62. thirst += 5;
  63. hunger += 5;
  64. whisky += 0;
  65. gold += 5;
  66. }
  67.  
  68. public void Eat()
  69. {
  70. sleepy += 5;
  71. thirst -= 5;
  72. hunger -= 20;
  73. whisky += 0;
  74. gold -= 2;
  75. }
  76.  
  77. public void Drink()
  78. {
  79. sleepy += 5;
  80. thirst -= 10;
  81. hunger += 1;
  82. whisky -= 1;
  83. gold += 0;
  84. }
  85.  
  86. public void Shop4whisky()
  87. {
  88. sleepy += 5;
  89. thirst += 1;
  90. hunger += 1;
  91. whisky+= 1;
  92. gold -= 1;
  93. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement