nkholski Posted January 28, 2017 Share Posted January 28, 2017 Phaser Grid Physics plugin adds support for grid/tile based movement and physics to Phaser. It's still in early stages and the code is kind of messy but I want to release it to check interest and get feedback. I plan to update this post whenever I do an update. DEMO: http://metroid.niklasberg.se/gridPhysics/Github: https://github.com/nkholski/phaser-grid-physics UPDATE 2017-02-04 Now using brunch for building the plugin thanks to @samme Added possibility to block bodies from leaving tiles in certain directions. New issue: Tiles with internal blocks isn't compatible with current pathfinding implementation. Current features Any grid size (not necessarily squares, i.e. 8x16 is possible, and not restricted to sprite or tile sizes). Turn-based or real-time. Visual debugging Tile dimensions may differ from grid dimensions (but needs to be multiple of the grid dimensions, like 16x16 tiles on an 8x8 grid). Collision detection against tile layers Tile collisions on specified directions only Body size is not restricted to grid-size, and different body sizes may co-exist (but must be equal or a multiple of grid dimensions. The sprite graphics may differ from body size.) Path finding (easystar.js dependency) Moveable objects (can be chained, i.e. the player push one crate against another crate that will also move). Mass (and strength that limit total mass that can be pushed by the power of one sprite) Velocity, ("struggle" property that can slow down a body based on mass pushed) Populated properties like isMoving.x (boolean) or isBlocked.top (boolean). Planned features include conjoined bodies, collision callbacks, movement tweaks and other stuff. samme and Jambutters 2 Link to comment Share on other sites More sharing options...
samme Posted January 31, 2017 Share Posted January 31, 2017 On 1/28/2017 at 1:09 PM, nkholski said: Help wanted! I know some of you are experts on build configuration (don't even know what to call it). I still struggle to create something that builds files for distribution ("gridPhysics.min.js") and would really appreciate some assistance. Highly recommend Brunch. nkholski 1 Link to comment Share on other sites More sharing options...
samme Posted February 2, 2017 Share Posted February 2, 2017 I made this for you: https://github.com/samme/phaser-grid-physics-brunch nkholski 1 Link to comment Share on other sites More sharing options...
nkholski Posted February 3, 2017 Author Share Posted February 3, 2017 WOW! That's fantastic. Thank you so much. I'm just sorry I can't like your post more than once. I'll be alone with two feverish children today, but hope to be able to do some updates and then merge it with your version during this weekend. :-) Link to comment Share on other sites More sharing options...
nkholski Posted February 4, 2017 Author Share Posted February 4, 2017 I just updated the repository with the contribution from @samme. I also added the possibility to block bodies from leaving tiles in certain directions. I updated the demo and screenshot in the first post of this thread to demonstrate this feature that makes the hill in the right side of the demo screen possible. samme 1 Link to comment Share on other sites More sharing options...
Recommended Posts