Jump to content

Can anyone help me with this part of the game. Need a sprite to free fall after a button is pressed.


StephenDunne
 Share

Recommended Posts

  This is a group of sprites , I want the num1 sprite to free fall from the ship when The spacebar is pressed.
 
ufo = game.add.group();
    xray = ufo.create(732, 210, 'xray');
    ship = ufo.create(700, 175, 'sprite');
    num1 = ufo.create(718, 290, 'number1');
 
 
 
 
else if (dropButton.isDown)
{
//Move down
num1.body.velocity.y = 900;
xray.destroy;
}
 
 

When the drop button is pressed the sprite moves down the screen and is still connected to the ship. But what I want is for the sprite to free fall. Is there any documentation I can look at regarding this? Any working examples of a sprite in free fall after a button event?

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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