This site requires JavaScript, please enable it in your browser!
Greenfoot back

Discussions

You need to login to take part
Rss

Current Discussions

tollpatch

Multi Level Games

By tollpatch, with no replies.
My idea for a multi level game: It's a modification of Wombat, who has to push a loaf into a house to complete a level. In this moment I write only an abstract, if its not clear enough, ask more. Each level is a World, for example WombatWorld, IceWorld, WaterWorld, NightWorld...... The Actor classes are Wombat, House, Rock, Barrel and Loaf. Wombat is moved by arrow keys, Rocks and the House are fixed, the Loaf and the Barrels can be pushed by Wombat. These the only classes and are used in all levels. Within the Wombat class there is: <Code Omitted>Within the constructor of the XxxxWorld is: <Code Omitted> // otherwise ALL worlds will be run thru further on in the code, when the loaf reaches the house: <Code Omitted> Within the act methode of the World : <Code Omitted>The only thing I change from level to level is the image of the characters in the different worlds and within the creator how many rocks and barrels are there to create the difficulty of the level. Zamoht comments:
It works well up to 10 levels but not for 100.
I don't agree. One change may be helpfull: First generate a MasterWorld. It contains the act methode with arrow-key-reaction and level-end-detection. The LEVELWorlds than become subworlds. This supworlds ONLY have the positioning of the objects to form the level difficulty and the images. Anywhere this code has to be and whats bad to have it in a separate class? Besides I expact that this organisation makes it easy to write an level-generator for interested players. Whats the better way to a 100-level-game?