<<set $r1 to random(1,6)>><<if $r1 is 1>> Oof, you rolled $r1
You lose! [[restart?|start]] Or, stop [[here?|end]]
<<else>> $r1 ?
Nice! Roll [[again|r2]]?
Or, stop [[here|end]]
<</if>>
<<set $r2 to random(1,6)>><<if $r2 is 1>>
Oh no! you rolled a $r2! You lost all your points [[restart?|start]] Or, stop [[here?|end]]<<else>><<set $r2 to $r1+$r2>> $r2 ?!?!
Wow, you're on fire! [[roll again?|r3]],
Or, stop [[here|end]]
<</if>>
<<set $r3 to random(1,6)>><<if $r3 is 1>>Dang! lost your points. [[Restart?|start]] Or, stop [[here?|end]]<<else>><<set $r3 to $r2+$r3>>$r3 -- incredible. Let's [[see what your final score is|end]]
<</if>><<if visited("start") is 4>>
Sorry, you have run out of turns.
GAME OVER
<<else>>
[[Roll the die|r1]]
<</if>>
<<if $r3 gte 1>> You've earned $r3
<<elseif $r2 gte 1>> You've earned $r2
<<elseif $r1 gte 1>> You've earned $r1
<</if>>
<<button "THE END" "credits">><<script>>/* (code) */<</script>><</button>>
This is a prototype based on the core mechanics of the game of pig
In this game, if you roll a 1 you can either:
<ul>
<li>Restart (up to 3 times)</li>
<li>Or you can quit</li>
</ul>
If you roll anything else you can either:
<ul>
<li>Roll again and try to accumulate more points</li>
<li>Or you can quit with however many points you have then
</li></ul>
Each round you potentially accumulate more points or you can quit while you're ahead. There's always the chance you will lose all your points. You have three chances to restart if you roll a 1.
The goal is to accumulate high points without running out of turns
[[START THE GAME|start]]here is where you can put end credits
Here is a restart option using an "open in new browser tab" HTML trick.
By using a new browser tab, you will erase any accumulated variable values.
You'll need to edit the URL below to match your own Twine file!
<a href="https://clogosphere.neocities.org/if/pig_prototype_v2" target="_blank">Restart</a>