Reading in Events

Mmm, I love persistancy….ugh. But it has to be done; it’s just not good to have numbers and strings defined in your code, with lots of if statements. So I’ve set the list of events to read in my a file. So this isn’t persistancy as such, but at some point things will need to be written to file for the save games. Next I need to write a sub-routine which sets up the current environment by reading in the map and list of events. Something like:

ChangeWorld(map, events):

newevents = ReadFile(events)

newmap = ReadFile(map)

return newevents, newmap

I guess this would first be called by the initial menu screen, which sets the gameloop attributes map and eventlist, and then called again by the event class whenever the player changed location. It’ll have to be defined within the event class, in this case.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: