BenClarkson Posted July 7, 2014 Share Posted July 7, 2014 Hi, I'm developing a quick framework to let at risk inner city youth design video game levels for a workshop I am leading next week. I have been playing around with phaser for about a month and I've got a decent handle of P2 and Arcade, but as I looked closer to what I'd need to be able to do to let the kids just draw levels on paper and then transfer that into a framework I've settled on Ninja because it allows for bounds, one way platforms and the overlay callback which lets them include some pretty standard platformer mechanics that I predict they'll want to include.So I am just having a little bit of trouble getting the slopemap to work with a tilemap. I am using the default ninja tilemap and then I am planning to import the art the kids draw overtop of the tiles so it looks like their characters are walking on the actual sprites. I am having a hell of a time actually getting this to work. Any help would be appreciated. The limited examples for Ninja physics is really draining. I really want to have a working prototype by the time I present the workshop. I'm going to be asking a lot of questions this week because I really want to present something fun for the kids to fuel their interest in computers (which are awesome)Cheers Link to comment Share on other sites More sharing options...
rich Posted July 7, 2014 Share Posted July 7, 2014 Will try and help as much as I can, but really need a more specific / targeted question to kick-off against first. Link to comment Share on other sites More sharing options...
BenClarkson Posted July 7, 2014 Author Share Posted July 7, 2014 You're the best Rich. I have some questions. I bashed my head against my desk.I got my tileset to work. If I want different classes of tiles (one way platforms) I will have to place those on another layer with different properties correct?Right now to evaluate collisions with the tileset I am basically looping through all the tiles like in the tileset example and checking AABBVSTileset collisions. Will I have to do this independently for every layer? This seems very expensive. Is there a way to optimize that with groups?Ladders and spikes would also be on different layers? For these I would be doing an overlay check right?And for placing the art on top of the tileset I'd just put a sprite on the top of the draw group? Is there a more efficient way of managing large art maps like the kids will draw (ie breaking them up as a group?)Thanks a lot. I am really excited to show everyone what the kids end up making. Link to comment Share on other sites More sharing options...
rich Posted July 7, 2014 Share Posted July 7, 2014 I would use Sprites for all non-standard tiles (one-way platforms, ladders) as they'll need custom handling. You can check Sprite vs. Tileset collision with a single call:game.physics.ninja.collide(sprite1, tiles);.. which will do the rest for you. But there's no support for Group vs. Tileset at the moment in Ninja (lots of the similar Arcade Physics commands are missing from there too - please be wary of this). Adding art on-top - for the tiles I would take one of the PNGs from resources\Ninja Physics Debug Tiles and just draw over the top then import that into Tiled and edit your level to your hearts content. Got to be easier than placing down a Sprite over the top of every tile. Link to comment Share on other sites More sharing options...
BenClarkson Posted July 7, 2014 Author Share Posted July 7, 2014 There's also the issue of resizing AABB for the player sprite. I know it's possible but I have to use a constructor which hasn't been working for me. Can you help me out with the syntax? Link to comment Share on other sites More sharing options...
Recommended Posts