Jump to content

calling a function


Recommended Posts

I'd like to create a function and be able to call it in another function. 

this one specifically 

   function coins(coin)
                this.physics.add.collider(coin, platforms);
                this.physics.add.collider(player, coin, collectCoin, null, this);

That way every time the coin is created I can call the function for the coin's physics. 

Link to comment
Share on other sites

Well never mind. I'll just copy and paste it every time I create the coin no biggie. 

I've come across another problem though. 

I want to use the checkDown(key,[,duration]) method

I'm tying to make it so my character waits before it punches every time I press the shift key.

Link to comment
Share on other sites


  • Recently Browsing   0 members

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