### we jump here when we want to roll a die ### label roll_die: $ renpy.random.shuffle(die_faces) # we pick one of six die face image files $ die_face = die_faces[0] show die at rotation if bonus > 6: $ bonus = 6 if bonus > 0: show die_bonus at bonus_die_position "..." $ die_sum = die_face + bonus if die_sum <= 2: $ result = "failure" play sound "sounds/Uh oh.wav" if die_sum < 5 and die_sum > 2: $ result = "partial" play sound "sounds/Whit.wav" if die_sum >= 5: $ result = "success" play sound "sounds/Temple.wav" hide die show die_static at die_position "You rolled [die_sum]!" hide die_static hide die_bonus $ renpy.jump(dest) # jump back to the dest variable which is set to whatever scene/room comes after this roll ### and in the game's init code... ### # dice default die_faces = [1,2,3,4,5,6] default die_face = die_faces[0] default bonus = 1 default die_sum = 0 default result = "" image die: "die_[die_faces[1]].png" 0.05 "die_[die_faces[2]].png" 0.05 "die_[die_faces[3]].png" 0.05 "die_[die_faces[4]].png" 0.05 "die_[die_faces[5]].png" 0.05 repeat $ bonus_die_position = Position(xpos=266, ypos=158) $ die_position = Position(xpos=226, ypos=158) image die_bonus: "die_[bonus]_invert.png" image die_static: "die_[die_face].png" # this is how we rotate the die transform rotation: xpos 200 ypos 120 #around (.5, .5) alignaround (.5, .5) xalign .5 yalign .5 rotate 0 linear 1 rotate 360 repeat ### inventory screen ### screen game_menu(): frame: style "quick_button" xpos 440 ypos 40 imagebutton idle "inv.png" hover "inv_hover.png" action [Play("sound", "sounds/Click.wav"),Hide("game_menu"),Show("inventory_show")] #,Call("inv") default objHov0 = "Unhovered" default objHov = "Unhovered" screen inventory_show(): modal True window: add "spiral.png" xpos -8 ypos -16 # returns frame: style "quick_button" xpos 440 ypos 40 imagebutton idle "inv.png" hover "inv_hover.png" action [Play("sound", "sounds/Click.wav"),Hide("inventory_show"),Show("game_menu")] # displays what ya got frame: style "quick_button" xpos 40 ypos 48 text "{b}My stuff{/b}" text "$[money]": ypos 16 $ rr = 0 for i in range(0, len(inventory_list)): $ r = inventory_list[i] $ rr += 1 textbutton "[r]": style "quick_button_text" ypos (16 + (rr*16)) action NullAction() if r == "Gamegirl": tooltip "Your beloved Purple Semi-Translucent Gamegirl." $ tooltip = GetTooltip() # displays what y'ar frame: style "quick_button" xpos 280 ypos 48 text "{b}Me{/b}" textbutton "Brains [brain]": ypos 16 style "quick_button_text" action NullAction() tooltip "The ol' noodle" textbutton "Brawn [strength]": ypos 32 style "quick_button_text" action NullAction() tooltip "Sock em bop em!" textbutton "Bcharisma [charisma]": ypos 48 style "quick_button_text" action NullAction() tooltip "The gift of gab!" frame: style "quick_button" xpos 280 ypos 128 text "{b}Traits{/b}" $ rr = 0 for i in range(0, len(trait_list)): $ r = trait_list[i] $ rr += 1 textbutton "[r]": style "quick_button_text" ypos (-16 + (rr*16)) action NullAction() if r == "Fungal Brain Parasite": tooltip "Not gonna lie...feels pretty good..." $ tooltip = GetTooltip() if tooltip: frame: style "quick_button" xpos 180 ypos 180 xmaximum 260 padding (10,10,10,10) background "#000000" text "[tooltip]": style "tooltip_button" screen popup(): frame: xpos 32 ypos 250 background "white" text "[tooltip]": style "tooltip_button"