1 decade ago by zaemz
Heya guys,
I've been following the documentation on the PhoneGap website, and I can get a PhoneGap project to compile and run on my phone, and in the emulator both using Eclipse and the CLI, but for some dang reason, I cannot get the game to initialize or start running. The regular black index will come up with the white rectangle, but nothing occurs after that. I can't tell if anything is even being attempted to load.
My biggest problem is that I have no idea how to start the code for the game. When does Impact initialize? Does it technically start when I call ig.game(blah, blah)?
I literally kept my index.html the same except I added `cordova.js`
And then in my main.js file, at the end of it before the end of the final closing braces, I have:
As far as I can tell, when I comment that line and try to let her rip in the browser on my PC, it's pretty much the same effect I'm getting on my Android device.
From here on out, I have no idea. The documentation specifies setting a callback for the deviceready event, but again, I don't know where to specify that callback, or if my code is even firing.
I apologize for any incoherence and whatnot, I've been fighting with this for 4-5 hours, and it's 3am. I just want to get it to work, but I'm heading to bed for now.
Thanks for any ideas and help!
I've been following the documentation on the PhoneGap website, and I can get a PhoneGap project to compile and run on my phone, and in the emulator both using Eclipse and the CLI, but for some dang reason, I cannot get the game to initialize or start running. The regular black index will come up with the white rectangle, but nothing occurs after that. I can't tell if anything is even being attempted to load.
My biggest problem is that I have no idea how to start the code for the game. When does Impact initialize? Does it technically start when I call ig.game(blah, blah)?
I literally kept my index.html the same except I added `cordova.js`
<!DOCTYPE html> <html> ... all the same ... blah blah ... <script type="text/javascript" src="lib/impact/impact.js"></script> <script type="text/javascript" src="cordova.js"></script> <script type="text/javascript" src="lib/game/main.js"></script> </head> <body> <canvas id="canvas"></canvas> </body> </html>
And then in my main.js file, at the end of it before the end of the final closing braces, I have:
// Start the Game with 60fps, a resolution of 400x240, scaled // up by a factor of 2 ig.main('#canvas', MainMenu, 60, 400, 240, 2, MyLoader);
As far as I can tell, when I comment that line and try to let her rip in the browser on my PC, it's pretty much the same effect I'm getting on my Android device.
From here on out, I have no idea. The documentation specifies setting a callback for the deviceready event, but again, I don't know where to specify that callback, or if my code is even firing.
I apologize for any incoherence and whatnot, I've been fighting with this for 4-5 hours, and it's 3am. I just want to get it to work, but I'm heading to bed for now.
Thanks for any ideas and help!