(Solved) Question about Boolean Variables
Posted: Thu Oct 12, 2023 1:21 pm
New to ren'py. This functionality figures prominently in my game, so want to make sure I am doing it right. Here is my code:
Code: Select all
init:
## All variables are in a seperate varables.rpy file.
$ crawlacrossfield = False
$ walkacrossfield = False
$ runacrossfield = False
label edgeofthefield:
scene scene2image1
pvts "This looks dangerous. What should we do?"
scene scene2image2
menu:
"We should low crawl across.":
$ crawlacrossfield = True
jump crawlacrossfield
"We should walk aross.":
$ walkacrossfield = True
jump walkacrossfield
"We should run across.":
$ runacrossfield
jump runacrossfield
return
label crawlacrossfield:
scene scene2aimage1
mc "We're gonna low crawl. The tall grass will hide us from snipers."
jump afteractionreview1
return
label walkacrossfield:
scene scene2bimage1
mc "We're gonna move carefully across. Watch your sectors of responsibilty."
jump afteractionreview1
return
label runacrossfield:
scene2cimage1
mc "We're gonna run like Hell. We'll be across before they can react."
jump afteractionreview1
return
label afteractionreview1:
scene scene3image1
co "Great job out there Sergeant."
scene scene3image2
mc: "Thank you, Sir."
if crawlacrossfield == True:
co "It was smart crawling to avoid snipers."
elif walkacrossfield == True:
co "I might not have moved that slow across a danger area."
elif runacrossfield == True:
co "It was smart to move quickly across the danger area."
scene scene3image3
co "Move your squad out, Sergeant."
return