toto88x Posted July 17, 2014 Share Posted July 17, 2014 Hello, I was browsing reddit, and I discovered this preview of an indie game made with Unity: https://i.imgur.com/5jSP4yw.gif I think it looks great with it's 2.5D environment. And I'm wondering: is this something that can be done with Phaser? And if so, how? Thanks! :-) jmp909 1 Link to comment Share on other sites More sharing options...
rich Posted July 17, 2014 Share Posted July 17, 2014 It looks great, and I think it's possible too, but be under no illusion this will be a lot of hard work and most of the in-built phaser features (collision, physics, even input events) won't be much, if any, use to you. Link to comment Share on other sites More sharing options...
eguneys Posted July 17, 2014 Share Posted July 17, 2014 Can you explain that in english now and why not? Link to comment Share on other sites More sharing options...
rich Posted July 17, 2014 Share Posted July 17, 2014 Because nothing is in 2D, so everything that relies on 2D for its calculations, like all of the physics libs and input events, won't know what is going on. Link to comment Share on other sites More sharing options...
pandavigoureux29 Posted July 18, 2014 Share Posted July 18, 2014 Seems possible to me too, you just have to simulate parallax behaviour on each sprite in the game. For example, sprites on the bottom scroll faster that the player, who is at the center of the screen. Also, you have to scale your sprites along the y value, taking the center of the camera a reference for scale = (1,1). I haven't tested it but this seems like the general behaviour I can think of seeing your gif. About inputs and collisions, if you scale the bodies with the graphics, I don't see either why it shouldn't work, but I may be overlooking something here. Link to comment Share on other sites More sharing options...
lewster32 Posted July 18, 2014 Share Posted July 18, 2014 The point Rich is making is that this would require a fair bit of modification to how Phaser works 'out of the box'. For instance, 2D collision would no longer be relevant if the sprites could go behind and in front of one another - you'd need to modify how that worked significantly so it had discreet 'planes' of collision (like Golden Axe, Streets of Rage etc) or even some kind of 3D collision in the case that objects had different 'depths'. Link to comment Share on other sites More sharing options...
pandavigoureux29 Posted July 18, 2014 Share Posted July 18, 2014 I see your point, but still think it can be done by a good management of the bodies and shapes ( having a solid shape just for the feet for example, and a sensor for the rest of the body ) Now the best way to be sure would be to test it, but as Rich said it would take a lot of time, and I don't have it Link to comment Share on other sites More sharing options...
lewster32 Posted July 18, 2014 Share Posted July 18, 2014 Actually that's a good point, I'd not really thought about collision working like that. I guess if you don't ever stand on top of objects, you can get away with just a flattened rectangle at their feet to represent the space they take up on the floor. Link to comment Share on other sites More sharing options...
rich Posted July 18, 2014 Share Posted July 18, 2014 The problem with physics isn't so much the collision, it's the separation. Because unlike with a 2D view you'd want to rebound the player into, or out of, the screen - so his y coordinate may barely change at all but it's the scale that would need to adjust. And there's no way the physics system is spatially aware to handle that Like I said, a lot of custom code needed. Probably too much imho. Link to comment Share on other sites More sharing options...
Recommended Posts