Code: Select all
label minigame:
if chapter == 2 and winner == 'c':
jump bakinggame
else:
jump socialgame
style minigametext:
font "vgafix.ttf"
init python:
import random
class SocialWord:
def __init__(self, word, cPoint, jnPoint, jaPoint):
self.word = word
self.cPoint = cPoint
self.jnPoint = jnPoint
self.jaPoint = jaPoint
social_words = []
with renpy.file('SocialWords.txt') as wordfile:
for line in wordfile:
line = line.strip()
if line == '' or line[0] == '#': continue
x = line.split(',')
social_words.append(SocialWord(x[0], int(x[1]), int(x[2]), int(x[3])))
label socialgame(transition=True):
stop music fadeout 2.0
scene grey with fadeoutslow
show screen quick_menu
#play music
$ config.skipping = False
$ config.allow_skipping = False
if chapter == 1:
call screen intro("What is everyone up to these days?\n\nPick out posts that you're friends\n have shared and pertain to whomever you like most!", ok_action=Return())
python:
progress = 1
numWords = 25
words = list(social_words)
cPoint=0
jnPoint=0
jaPoint=0
ystart = 270
while True:
pstring = str(progress)
ui.text(pstring + "/" + str(numWords), xpos=790, ypos=200, color='#000')
for j in range(2):
if j == 0:
x = 510
else:
x = 650
for i in range(4):
word = random.choice(words)
words.remove
ui.textbutton(word.word, clicked=ui.returns(word), xpos=x, ypos=i * 52 + ystart)
t = ui.interact()
if t.cPoint >= 2:
renpy.show("chara leap")
if t.jaPoint >= 2:
renpy.show("jessica leap")
if t.jnPoint >= 2:
renpy.show("jamison leap")
cPointTotal += t.cPoint
jaPointTotal += t.jaPoint
jnPointTotal += t.jnPoint
progress += 1
if progress > numWords:
renpy.jump('points')
label points:
if jnPoint > jaPoint and jnPoint > cPoint:
$ winner = 'jn'
elif jaPoint > cPoint:
$ winner = 'ja'
else:
$ winner = 'c'
$ config.allow_skipping = True
$ allow_skipping = True
stop music fadeout 2.0
hide screen quick_menu
scene black with dissolveslow
pause 1.0
return