1
# This is the main program. This can be changed quite a bit to
2
# customize it for your program... But remember what you do, so you
3
# can integrate with a new version of DSE when it comes out.
5
# Declare black, so we can use it in the game,
7
image black = Solid((0, 0, 0, 255))
9
# This is the entry point into the game.
12
# Required to initialize the event engine.
13
call events_init from _call_events_init_1
15
# Initialize the default values of some of the variables used in
19
# Initialize the statistics used by the game.
20
$ strength = Stat('Strength', 10, 100)
21
$ intelligence = Stat('Intelligence', 10, 100)
23
# Pick the stats to show to the user.
24
$ shown_stats = [ strength, intelligence ]
26
# Show a default background.
29
# The script here is run before any event.
31
"In case you're just tuning in, here's the story of my life to
34
"I'm a guy in the second year of high school."
36
"I'm not good at sports or school or even something as simple as
37
remembering peoples names."
39
"In short, I am your usual random loser guy."
41
"And this is my story..."
44
# We jump to day to start the first day.
48
# This is the label that is jumped to at the start of a day.
51
# Increment the day it is.
54
# We may also want to compute the name for the day here, but
55
# right now we don't bother.
59
# Here, we want to set up some of the default values for the
60
# day planner. In a more complicated game, we would probably
61
# want to add and remove choices from the dp_ variables
62
# (especially dp_period_acts) to reflect the choices the
63
# user has available to him.
66
$ afternoon_act = None
69
# Now, we call the day planner, which may set the act variables
71
call day_planner from _call_day_planner_1
74
# We process each of the three periods of the day, in turn.
77
# Tell the user what period it is.
80
# Set these variables to appropriate values, so they can be
81
# picked up by the expression in the various events defined below.
85
# Execute the events for the morning.
86
call events_run_period from _call_events_run_period_1
88
# That's it for the morning, so we fall through to the
93
# It's possible that we will be skipping the afternoon, if one
94
# of the events in the morning jumped to skip_next_period. If
95
# so, we should skip the afternoon.
96
if check_skip_period():
99
# The rest of this is the same as for the morning.
103
$ period = "afternoon"
104
$ act = afternoon_act
106
call events_run_period from _call_events_run_period_2
111
# The evening is the same as the afternoon.
112
if check_skip_period():
120
call events_run_period from _call_events_run_period_3
125
# This is now the end of the day, and not a period in which
126
# events can be run. We put some boilerplate end-of-day text
131
"It's getting late, so I decide to go to sleep."
133
# We call events_end_day to let it know that the day is done.
134
call events_end_day from _call_events_end_day_1
136
# And we jump back to day to start the next day. This goes
137
# on forever, until an event ends the game.
141
# This is a callback that is called by the day planner. One of the
142
# uses of this is to show the statistics to the user.
146
# Add in a line of dialogue asking the question that's on
148
$ narrator("What should I do today?", interact=False)
150
call stats_show from call_stats_show_1