summaryrefslogtreecommitdiffhomepage
path: root/samples/18_moddable_game/app/decision.rb
blob: 29210762e3966efbb4e524da732aff9ac984899d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# Hey there! Welcome to Four Decisions. Here is how you
# create your decision tree. Remove =being and =end from the text to
# enable the game (just save the file). Change stuff and see what happens!

def game
  {
    starting_decision: :stormy_night,
    decisions: {
      stormy_night: {
        description: 'It was a dark and stormy night. (storyline located in decision.rb)',
        option_one: {
          description: 'Go to sleep.',
          decision: :nap
        },
        option_two: {
          description: 'Watch a movie.',
          decision: :movie
        },
        option_three: {
          description: 'Go outside.',
          decision: :go_outside
        },
        option_four: {
          description: 'Get a snack.',
          decision: :get_a_snack
        }
      },
      nap: {
        description: 'You took a nap. The end.',
        option_one: {
          description: 'Start over.',
          decision: :stormy_night
        }
      }
    }
  }
end