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 mimik

Having some trouble getting started with using impact with cocoon.js
How do i get it to start?
Do i build the game like a iosImpact ready game with the index in a js file or how do i use it?

theres no DOM so i cant really start the game at all

Any clues?

1 decade ago by amadeus

There's no HTML file for Cacoon.

With that noted, right before your game initialization code:

ig.main('#canvas', YourGame, 60, 480, 320, 1);

Put something like:

var c = document.createElement('canvas');
c.id = 'canvas';
document.body.appendChild(c);

(You can name the variable c whatever you'd like)

This code has the added benefit of also working in a normal Impact Game, just make sure there is no Canvas element already in your existing html file.

Then, with that code in place, run the impact bake script, then zip up the game.min.js with your /media directory and you should be good to go. Upload it to the cocoon launcher and it should at least boot. (there are other potential compatibility problems of course)

1 decade ago by Nico

I'm also trying to mess with cocoon a bit.

I've got my app minified and zipped up with the media files, then I push it to a device with the Android SDK.

When I launch it in the Cocoon app it's just a black screen that tells me I'm running at > 1000 FPS. No errors, or warnings in sight, anyone know what I'm doing wrong?

1 decade ago by Nico

Also I just tried to push the Sumon demo that comes with Cocoon to my Android device.

Still just a black screen running at 1000+ FPS, and no errors :(

Wtf??

1 decade ago by fulvio

@amadeus: Thanks for providing this information. I ended up getting my game working in CocoonJS after a lot of problems. Do you know how to implement binding and touch areas?

Also does CocoonJS make it easier to support retina graphics with Impact? If so, how would I go about doing that?

1 decade ago by paulh

the advantage of coccoon js currently is that it can scale your game to any device.

the disadvantage of cocoon js currently is that it will scale your game to any device!

:-)

1 decade ago by dungeonmaster

I just made the canvas hack and launched my game in cocoonjs launcher app in android. Evewrything runs smooth BUT the fonts are garbled! I think this is related to how impact make sense of fonts and how cocoonjs scale the graphics etc..

Any workarounds?

1 decade ago by begeeben

Here's a good article for the problem:
link http://fragcastle.com/tech/2012/12/31/impactjs-with-cocoonjs/

1 decade ago by dungeonmaster

Thanks begeeben. This solves the problem of garbled fonts.

I read somewhere that using .fillText (as in the above plugin) is more slower then using bitmap fonts like impact's.

Does anybody has experience?
Page 1 of 1
« first « previous next › last »