How should I load level data in java?

Posted by Matthew G. on Game Development See other posts from Game Development or by Matthew G.
Published on 2013-11-02T06:37:56Z Indexed on 2013/11/02 10:15 UTC
Read the original article Hit count: 235

Filed under:
|

I'm setting up my engine for a certain action/arcade game to have a set of commands that would look something like this.

Set landscape to grass Create rocks at ... Create player at X, Y Set goal to "Get to point X Y" Spawn enemy at X, Y

I'd then have each object knowing what it has to do, and acting on its own. I've been thinking about how to store this data.

External data files could be parsed by a level class, and certain objects can be spawned through that.

I could also create a base level class and extend it for each level, but that'd create a large amount of classes.

Another idea is to have one level parser class, but have a case for each level. This would be extremely silly and bulky, but I mention it because I found that I did this at 2 AM last night. I'm finally getting why I have to plan out my inheritances, though. RIP project.

I might be completely missing another option.

© Game Development or respective owner

Related posts about java

Related posts about architecture