Page 1 of 1

Posted: Sat Apr 03, 2010 7:33 pm
Well I only want to ask... how can I make the choices sum up? Let me explain myself.

-Ending 1
-Ending 2

Example 1:
1. Run(Ending 1 +1)/Walk (Ending 2 +1) Chose Run. Ending 1 +1=> Ending 1= 1. Ending 2= 0
2. Eat(Ending 1 +2)/Don't eat (Ending 2 +1) Chose Eat. Ending 1 +1=> Ending 1= 3. Ending= 0
You get ending 1.

Example 2:
1. Run(Ending 1 +1)/Walk (Ending 2 +1) Chose Walk. Ending 2 +1=> Ending 1= 0. Ending 2= 1
2. Eat(Ending 1 +2)/Don't eat (Ending 2 +1) Chose Don't eat. Ending 2 +1=> Ending 1= 0. Ending= 2
You get ending 2.

Can someone explain how to do this? Thanks in advance.

Posted: Sun Apr 04, 2010 10:27 am
You mean something like this?:

Code: Select all

``````init:
\$ Ending1=0
\$ Ending2=0
label choice1:
"Run":
\$ Ending1+=1
"Walk":
\$ Ending2+=1

label choice2:
"Eat":
\$ Ending1+=2
"Don't Eat":
\$ Ending2+=1

label ending:
if Ending1==3:
jump ending1
elif Ending2==2:
jump ending2

``````

Posted: Sun Apr 04, 2010 10:46 am
Well, exactly as you showed in your example...
1. Make variables to store the results (end1, end2 or smth)
2. Change the values during game process (like <\$ end1 += 1>)
3. At the end compare the values to find what ending to show

Code: Select all

``````init:
\$ end1 = 0
\$ end2 = 0

label start:
"Run(Ending 1 +1)":
\$ end1 += 1
"Walk (Ending 2 +1)":
\$ end2 += 1

"Eat(Ending 1 +2)":
\$ end1 += 2
"Don't eat (Ending 2 +1)":
\$ end2 += 1
if end1 > end2:
jump "ending_1" # label names shouldn`t have spaces
else:
pass

# here you goes if ending 2
"Ending 2"
jump "credits"

label ending_1:
"Ending 1"
jump "credits"

label credits:
"Some credits"``````