loafer Posted December 9, 2014 Share Posted December 9, 2014 I am new to phaser.js and to enhance my skills I am trying to write a clone of my all time favorite: Metroid FusionYou can find the current milestone here: http://loafer-project.com/metroid/ Quote Link to comment Share on other sites More sharing options...
PixelPicoSean Posted December 10, 2014 Share Posted December 10, 2014 That's also my all time favorite Looks nice so far, how do you make that slope collision? Ninja physics? Quote Link to comment Share on other sites More sharing options...
loafer Posted December 10, 2014 Author Share Posted December 10, 2014 No I didn't use ninja, I wrote slope functions for arcade physics. Below you can see the function I wrote for a one-tile slope facing right. Hope it helps someone.function (i, body, tile) { /* .__ | | a | | |\p__| | \ |__\ c b */ var collides = Phaser.Physics.Arcade.isPointInTriangle( body.position.x, // px body.position.y + body.height, // py tile.worldX - tile.width, // ax tile.worldY - tile.height, // ay tile.worldX + (tile.width * 2), // bx tile.worldY + (tile.height * 2),// by tile.worldX - tile.width, // cx tile.worldY + (tile.height * 2) // cy ); if (collides && body.position.x >= tile.worldX) { body.y = tile.worldY - body.height + (body.position.x - tile.worldX); if (body.y < tile.worldY - body.height) { body.y = tile.worldY - body.height; } if (body.y > tile.worldY + tile.height - body.height) { body.y = tile.worldY + tile.height - body.height; } body.velocity.y = 500; body.blocked.down = true; return false; } return true; } Quote Link to comment Share on other sites More sharing options...
PixelPicoSean Posted December 11, 2014 Share Posted December 11, 2014 Wow, that's simple and clean, thanks. Quote Link to comment Share on other sites More sharing options...
loafer Posted December 18, 2014 Author Share Posted December 18, 2014 I just released a major update including working doors, power grip and new rooms. I also changed the controls to be prepared for shoulder buttons. You can play the current version at http://loafer-project.com/metroid/ and browse the source code at http://github.com/geselle-jan/Metroid. Quote Link to comment Share on other sites More sharing options...
loafer Posted December 22, 2014 Author Share Posted December 22, 2014 I just released a minor update.The power grip now has the correct pull-up animation and I added a few new rooms to explore. Enjoy! Quote Link to comment Share on other sites More sharing options...
loafer Posted January 8, 2015 Author Share Posted January 8, 2015 New update is out!Samus now has all jump animations and I implemented a more true-to-the-original solution for falling down and off edges.Last but not least the website has been remade an now features a development blog. Check it out:Blog: http://loafer-project.com/Game: http://loafer-project.com/metroid/ Quote Link to comment Share on other sites More sharing options...
Bolko Posted January 8, 2015 Share Posted January 8, 2015 Cool project, a little small in the browser.Strange for me that i cannot jump with W, but thats probably reserved for aiming up?I like how he can pull up himself. Grüße aus Bayern Quote Link to comment Share on other sites More sharing options...
SignalSin Posted January 8, 2015 Share Posted January 8, 2015 Oh wow, this is really cool! It's a bit of a dream of mine, to make an original Metroidvania, so I'm eagerly awaiting further progress on this. Keep up the awesome work! Quote Link to comment Share on other sites More sharing options...
loafer Posted January 8, 2015 Author Share Posted January 8, 2015 Thank you for the kind replies. @BolkoThe game size is so small because it's the original resolution of the GameBoy Advance. As soon as the movement is complete I will probably increase it four times. @SignalSinIf thats a dream of yours then just get started! Feel free to fork my repository on GitHub. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.