Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- OpenWindow(0,100,100,200,300,"AlcoSim")
- lives = 4
- day = 1
- daysIndic = TextGadget(4,10,10,100,40,"You need stay alive 1 week")
- goalTxt = TextGadget(5,10,50,100,40,"Day: 1")
- liveIndic = TextGadget(1,10,90,100,40,"♥♥♥♥")
- workBtn = ButtonGadget(2,10,130,100,40,"Work - ♥")
- drinkBtn = ButtonGadget(3,10,170,100,40,"Drink + ♥♥♥")
- Procedure Indicator(lives.l,days.l)
- If lives<0
- Text.s="-ღღღღ"
- Debug "You died of thirst"
- Else
- Select lives
- Case 0
- Text.s="ღღღღ"
- Case 1
- Text.s="♥ღღღ"
- Case 2
- Text.s="♥♥ღღ"
- Case 3
- Text.s="♥♥♥ღ"
- Case 4
- Text.s="♥♥♥♥"
- Default
- Text.s="♥♥♥♥+"
- Debug "You dead. Drink too much"
- EndSelect
- EndIf
- SetGadgetText(1,Text)
- dayTxt.s = "Day: " + Str(days)
- SetGadgetText(5,dayTxt)
- EndProcedure
- Repeat
- ev = WaitWindowEvent()
- ; вопрос: если у меня гаджеты заданы переменными, как к ним обращаться через имена переменных, а не через номера гаджетов?
- Select ev
- Case #PB_Event_Gadget
- If day>7
- Debug "you win"
- Else
- Select EventGadget()
- Case 2
- Select EventType()
- Case #PB_EventType_LeftClick
- lives - 1
- day + 1
- Indicator(lives,day)
- EndSelect
- Case 3
- Select EventType()
- Case #PB_EventType_LeftClick
- lives +3
- day + 1
- Indicator(lives,day)
- EndSelect
- EndSelect
- EndIf
- EndSelect
- Until ev = #PB_Event_CloseWindow
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement