nkholski Posted January 16, 2017 Share Posted January 16, 2017 UPDATE After posting this I decided to create a repository on Github and I made a new "official" thread in the forum to post updates on the progress, and for anyone to drop questions, ideas and stuff. Github: https://github.com/nkholski/phaser-grid-physics Forum: http://www.html5gamedevs.com/topic/28051-grid-physics-plugin/ ----------------------------------------------------------------------------------------- Hi all, I've been thinking of doing an old-school RPG for a while (haven't we all?), and decided to start with a plugin for grid-based "physics" for me to use. I reached a point where I got most of what I will need, and thought I could share a small demo. If there is interest I might improve the plugin and remove parts that are tied to my game so that others may use it (it would be really easy to make something like Sokoban with this). The demo is here: http://metroid.niklasberg.se/gridPhysics/ The hero is controlled with the arrow keys. Use the controls in dat-gui in the upper right corner of the browser to change properties. Things to do: Push objects (even multiple objects in chains). Walk or push things into one-way directional tiles. Explore the Hero properties. Code examples //Init 8x8 grid physics game.plugins.add(new GridPhysics(this.game)); game.physics.gridPhysics.gridSize = { x: 8, y: 8 }; //Enable grid collision on a tile map layer game.physics.gridPhysics.enable(layer); // Enable grid body on sprite: game.physics.gridPhysics.enable(sprite); samme and phreaknation 2 Link to comment Share on other sites More sharing options...
rich Posted January 16, 2017 Share Posted January 16, 2017 Lovely demo You may want to enable cursor key capture (to stop the page scrolling when you press down) Link to comment Share on other sites More sharing options...
nkholski Posted January 17, 2017 Author Share Posted January 17, 2017 Thanks! I've enabled cursor key capture now. Link to comment Share on other sites More sharing options...
phreaknation Posted January 17, 2017 Share Posted January 17, 2017 Love this. This SHOULD be a plugin. Link to comment Share on other sites More sharing options...
nkholski Posted January 18, 2017 Author Share Posted January 18, 2017 It IS a plugin, just not public (yet) :-). I started to strip game specific hard coded stuff from it yesterday. It should be on GitHub within a couple of days. phreaknation 1 Link to comment Share on other sites More sharing options...
phreaknation Posted January 18, 2017 Share Posted January 18, 2017 That is basically what I meant. I am having to do the same thing with all of my plugins that I am doing. Here in a couple months I should be releasing about four or five of my own Link to comment Share on other sites More sharing options...
samme Posted January 18, 2017 Share Posted January 18, 2017 Maybe gridSize could be a Phaser.Point? game.physics.gridPhysics.gridSize.set(8); nkholski and phreaknation 2 Link to comment Share on other sites More sharing options...
hexus Posted February 18, 2017 Share Posted February 18, 2017 This looks awesome! nkholski 1 Link to comment Share on other sites More sharing options...
nkholski Posted February 18, 2017 Author Share Posted February 18, 2017 Thanks! After posting this I decided to create a repository on Github and I made a new "official" thread in the forum to post updates on the progress, and for anyone to drop questions, ideas and stuff.Github: https://github.com/nkholski/phaser-grid-physicsForum: http://www.html5gamedevs.com/topic/28051-grid-physics-plugin/ Link to comment Share on other sites More sharing options...
MikeStalon Posted March 18, 2017 Share Posted March 18, 2017 I really do not understand how to launch the demo, the files are misplaced. Great initiative though. Link to comment Share on other sites More sharing options...
nkholski Posted March 18, 2017 Author Share Posted March 18, 2017 If you just want to check it out there is a demo online here: http://metroid.niklasberg.se/gridPhysics/ Otherwise, there are instructions at the end of the README.md-file ("brunch watch --server" to watch files and launch the server). Note that you need to navigate to http://localhost:3333/demo/ (not http://localhost:3333). I have had an unexpectedly busy period with unrelated stuff and haven't had time to work on the plugin for a while. However, it's far from abandoned and I plan to pick up the development as soon as things calm down. Link to comment Share on other sites More sharing options...
Recommended Posts