taptak Posted February 14, 2014 Share Posted February 14, 2014 Hey there - my first post. I have a sprite which bounces up onTap as below:tap = function() { var tween; bug.body.velocity.y = -100; tween = game.add.tween(bug.body.velocity).to({ y: -100 }, 25, Phaser.Easing.Bounce.In, true); tween.onComplete.add(function() { return bug.body.gravity.y = GRAVITY; }); bugSnd.play();};game.physics.gravity.y = 100; What I need is a global physics like a wind which would push the sprite in a direction and onTap would move the sprite up and against the wind. Hoping I've described this right. Code snippet much appreciated. Thanks in advance for your help. (I'm new to Phaser but I've been immersed in everything I can learn during this past week and lovin' it.) Quote Link to comment Share on other sites More sharing options...
SpriteWrench Posted February 14, 2014 Share Posted February 14, 2014 Try adding. game.physics.gravity.x = <whatever value feels right>; Quote Link to comment Share on other sites More sharing options...
taptak Posted February 15, 2014 Author Share Posted February 15, 2014 Doh! Thanks. Yes, that and a few other bits was what I needed. 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.