Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int sleepy = 0;
- int thirst = 0;
- int hunger = 0;
- int whisky = 0;
- int gold = 0;
- void setup()
- {
- size (500,600);
- background(0);
- textSize(25);
- for(int i = 0;i < 1000; i++){
- clear();
- text("Sleepy = " + sleepy,180,100);
- text("Thirst = " + thirst,180,150);
- text("Hunger = " + hunger,180,200);
- text("Whisky = " + whisky,180,250);
- text("Gold = " + gold,180,300);
- text("i = " + i,180,500);
- if(thirst >= 95 && whisky == 0){
- Shop4whisky();
- }
- else if(whisky == 1){
- Drink();
- }
- else if(hunger >= 90){
- Eat();
- }
- else if(sleepy >= 85){
- Sleeping();
- }
- else {
- Mining();
- }
- if(sleepy > 100 || sleepy < 0 || thirst > 100 || thirst < 0 || hunger > 100 || hunger < 0 || whisky >= 10 || whisky < 0 || gold < 0)
- {
- text("død",180,400);
- break;
- }
- }
- }
- public void Sleeping()
- {
- sleepy -= 10;
- thirst += 1;
- hunger += 1;
- whisky += 0;
- gold += 0;
- }
- public void Mining()
- {
- sleepy += 5;
- thirst += 5;
- hunger += 5;
- whisky += 0;
- gold += 5;
- }
- public void Eat()
- {
- sleepy += 5;
- thirst -= 5;
- hunger -= 20;
- whisky += 0;
- gold -= 2;
- }
- public void Drink()
- {
- sleepy += 5;
- thirst -= 10;
- hunger += 1;
- whisky -= 1;
- gold += 0;
- }
- public void Shop4whisky()
- {
- sleepy += 5;
- thirst += 1;
- hunger += 1;
- whisky+= 1;
- gold -= 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement