dcbriccetti Posted April 1, 2014 Share Posted April 1, 2014 Hi all. I just started using Phaser, and I’m excited by the potential. I could use some help with some problems in this game: http://davebsoft.com/web-games/invisible-maze/ https://github.com/dcbriccetti/web-games/commit/d814fe45a655e8fc0916149156fca95cb22c7a3c#diff-ad4eb6229e24f5cc681cc10695f640ca When the player character hits the “mines” (lightning bolts), he rotates. I don’t want him to. Sometimes the mines move about “aimlessly”. I don’t want them to move (except perhaps a little when the player character bumps them). I’ve looked at several examples and read some of the source code, but I feel like I’m still sort of guessing about a lot of things. Perhaps someone could give the code a quick general review? Thanks! Link to comment Share on other sites More sharing options...
rich Posted April 1, 2014 Share Posted April 1, 2014 To stop the player rotating you need to fix its body: http://docs.phaser.io/Phaser.Physics.P2.Body.html#fixedRotationSprite.body.fixedRotation = true;To stop the mines moving you probably want to do the same and then maybe make them static? Although that would completely stop them moving. Perhaps they just need a little more mass to make them heavier? Link to comment Share on other sites More sharing options...
dcbriccetti Posted April 1, 2014 Author Share Posted April 1, 2014 Thanks! I decided to let the mines move. I like the effect. The game is further along now. I would still love a code review if anybody is inclined. https://github.com/dcbriccetti/web-games/tree/master/invisible-maze Link to comment Share on other sites More sharing options...
ForgeableSum Posted March 8, 2016 Share Posted March 8, 2016 I don't suppose there is a way to fix the rotation for an object using Arcade physics? Suppose I want to rotate a sprite, use velocity from Rotation, but don't want the actual image texture to rotate? Link to comment Share on other sites More sharing options...
ForgeableSum Posted March 8, 2016 Share Posted March 8, 2016 Ah, nevermind. I could just change the rotation on another point object and use that to determine velocity instead of the sprite's point object. Silly question. Link to comment Share on other sites More sharing options...
Recommended Posts