Creating a newspaper that effects the game's economy?

Posted by zardon on Game Development See other posts from Game Development or by zardon
Published on 2012-10-11T13:12:25Z Indexed on 2012/10/11 15:49 UTC
Read the original article Hit count: 347

Filed under:
|
|

I am writing a game in Objective C/cocos2d where a newspaper is a central part of what controls or rather effects the game's world economy as well as what a city might do (such as increase X, reduce Y)

The newspaper is a bit like a "Chance card" in Monopoly, it has an effect on something.

My question is, what is the best way to do write a newspaper that has both a random and specific effect within the game.

Would the best strategy be to write out all the things a newspaper can affect, a PLIST of headlines (with placeholders).

I think Tiny Tower uses a PLIST of events and it randomly picks an event, but I'm not sure how it actually parses it because certain events do different things.

But then how do I parse all the scenarios that a newspaper can deliver? A big switch statement seems very long and complicated to do.

I am wondering if there is a simpler way to handle this kind of thing.

Related to this is that there might be no news that day and I'm not sure what the newspaper should display, should it just display the last headline?

So, in summary.

1) A newspaper generates a headline, it affects different things, such as the world economy, prices, how city reacts

2) I need the newspaper to generate headlines (although there may be days when there are no headlines at all), but I am not sure how to parse it without using a big-ass switch statement.

Thanks in advance.

© Game Development or respective owner

Related posts about random

Related posts about events