It depends on how much common logic the different levels share. For
example, if on the first level the player is fighting green sprites on
low platforms, but blue sprites on green platforms, then just a set of
level-describing files will suffice. If there is a small amount of
level-specific knowledge (i.e, the blue sprites sing and dance), then
the file can reference a class or function in your monolithic code. On
the other hand, if each level is totally different (i.e., level 1 is a
FPS and level 2 is an RTS), then you can describe each level in code
rather than in XML files.

Incidentally, XML has its advantages and disadvantages, as discussed
(among other things) here: 
http://code.google.com/events/io/sessions/CodingLifeBatteryLife.html



Yusuf Saib
Android
·T· · ·Mobile· stick together
The views, opinions and statements in this email are those of the
author solely in their individual capacity, and do not necessarily
represent those of T-Mobile USA, Inc.





On Jun 10, 2:32 pm, "Justin B. Burris" <[email protected]>
wrote:
> Hello all!
>
> I'm currently working on a game which will consist of multiple
> different levels. Forgive me if this seems rudimentary! I'll use the
> original Sonic the Hedgehog as an example.
>
> In sonic, you have various screens, each with different level designs
> for the player to traverse. These levels consist of tiles which are
> arranged to aid, or hinder the player in his attempt.
>
> The question I have is how do you go about creating these levels in
> code? And what is the best way to do so?
>
> I've currently come up with
> 1 : Have each level to be a class, and load up the proper level
> depending on player progress.
> 2 : Store the level information in a file or in XML, and load it up
> depending on player progress.
>
> Both of these solutions do not seem to be ideal, and it seems there
> could be a better way to develop this sort of system.
>
> What are your thoughts on a situation such as this?
>
> If this would be better suited in Android Developers, I can move the
> topic there, but it seems to be a more basic aspect for the platform.
>
> Thank you for any insight you may offer!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to