Balamurugan

How to call another file functions in phaser 3

Recommended Posts

I have 2  files as below:

file 1-

var deck = 0;

var game = {

   fun: function()

   {

       statements;

    }

}

file 2 -

var game1 = {

      I need to call file 1function. I dont know how to call. 

}

i am beginner for phaser 3. i dont know how to call..

Share this post


Link to post
Share on other sites
On 2/24/2018 at 10:06 PM, Horizonicblue said:

I think this should work


var game1 = {
  game.fun();
}

Is working fine thank you so much. But i also have a globel variable deck in file 1, or anyother options there, set a common global variable and use in another class. how to access also, please help us..

 

Share this post


Link to post
Share on other sites

Ok, thank you so much, i don't how to give reputation point to you, please share how to give reputation point to you...

And also i working this example i dont know how it is working. Please explain that, i attach my demo files.

 

 

Share this post


Link to post
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...

  • Recently Browsing   0 members

    No registered users viewing this page.