Jump to content

Sprite collision order


sreekanth3.gkm
 Share

Recommended Posts

Hai all,

im new here..

Im developing a small game in phaser...There is a player character,There are 3 different star sprites  bouncing around..The player can collect these stars...But i want the player to collect the stars in a specific order...Problem is how to check if the first collected star is the first one in the sequence..

I've a method called collectStar()

 

function collectStar (player, star) {
    
    // Removes the star from the screen
   if()
{
}
    star.kill();
    //  Add and update the score
    score += 10;
    scoreText.text = 'Score: ' + score;
}
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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