Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by MatthewHarmon

Hi folks:

Seasoned game dev, but new to Impact and JavaScript.

I need our game to be launched from another person's code. I did the following to defer the initialization of our game, but I'm not sure it is the recommended way:
launch: function() 
    {
    // need to load modules so we have "MyGame" ready
    ig._execModules();  
    ig.main('#canvas', MyGame, 30, 1024, 768, 1);
    }

Similarly, I need to exit the game loop and return to my caller. What is the correct procedure to do this?

Thanks!

1 decade ago by TigerJ

You can probably bake the impact game (which you should be doing) and then call
ig.system.setGame(MyGame);

to start the game.

To end the game loop I would use
ig.system.stopRunLoop();
//then your code as the game as stopped running (hide canvas ect...)

1 decade ago by MatthewHarmon

Thanks - looking into the .setGame idea now.

However, regarding ig.system.StopRunLoop(), my understanding is that just pauses the game loop. It doesn't "exit"- that is clean up all references and leave the game essentially garbage-collectable.

1 decade ago by JImpacter

Have you found a solution in the last 5 months Matthew?
I am looking to call my game from another application and return to it at the end of the level but I can't seem to find much help on how...
If you became a wizard over the last few months, I'm also looking to re-enter the game on a new level from a different point of the application. If you happen to know a way to do that I would appreciate it as well.
Page 1 of 1
« first « previous next › last »