Multiple levels



  • I'm extending the tutorial project but I'm unsure how to implement multiple levels. Do I make an array? Does someone have a project I can look at?



  • Hey @jgedri , it's a bit old but I do have a project you can look at, https://github.com/RichardBray/Scales-A-Pangolin-Story

    Basically the way I do multiple levels is to have a parent/super class LevelState.hx, which will have most of the level data, and keep unique things in the level files themselves like LevelOne.hx, LevelTwo.hx. I hope that makes sense.



  • Thank you! I made a second map file with Ogmo Editor; surely there's a way of wiring it all together.



  • I haven't used Ogmo before but I'm sure there is a way. What do you mean by 'writing it all together'? Do you mean linking from the level with the first map to the level with the second map?



  • That's exactly what I mean.



  • Ah okay, yeah there's definitely a way to do that. I'm not sure what type of game you're making but you could add a collision box to the end of the level with FlxObject or something and when the player collides with it run

    FlxG.switchState(new LevelTwo());
    

    Which will contain your new map. Let me know if this makes sense.



  • I'm basically messing around with the [url=https://haxeflixel.com/demos/TurnBasedRPG/]RPG demo[/url] so the condition is, more or less, "when player beats boss".

    @RichardBray I don't suppose you'd like to collaborate: you do the coding, I do the mapmaking.



  • Wow, I'm super flattered thanks for the offfer, but unfortunately, time isn't on my side at the moment :(
    I'm happy to help with any Flixel related questions you have though.


Log in to reply
 

Looks like your connection to HaxeFlixel was lost, please wait while we try to reconnect.