Jump to content

Got sprite but need wind...


taptak
 Share

Recommended Posts

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.)

 

 

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...