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 dominic

In case you somehow missed it, I released the new version of iOSImpact today - under a different name and open source license. Read the announcement in the blog or the project page for more info.

I hope you like it :)

So, in other news, because I was sidetracked with Ejecta for so long - much longer than I anticipated - this means that Impact 2.x will still take a while. I won't give you any estimate release date this time, because I'll screw it up anyway ;) Sorry; please be patient.

1 decade ago by Jerczu

You rule! Open sourcing it was a brilliant idea! Can't wait to see what people come up with. Been playing around with cocoon js but iOSimpact... sorry Ejecta seem to have all I need.

Quick question - can you tell me if it supports the background map animation now?

1 decade ago by dominic

Well, yes, BackgroundMap animations are supported, but they always were. You just can't use the preRender mode on layers that have animations.

Ejecta is a good deal faster than iOSImpact was, so you may not need the preRender anymore.

1 decade ago by Philip

Yeah!

Had to port Steamclash this evening and it went really well, even though I had a bit custom code in the iOS implementation. You fixed some hacks which is great :)

But unfortunately I don't see that much of an performance boost. Buthe drawing isn't really the problem here, it's more on the logic side. Thanks to the new XCode and iOS 6 I discovered that today.

It's sad that Apple doesn't allow JIT…

Anyway, great Job. THe code is now much cleaner an i'm looking forward to use it in the next project :)

1 decade ago by Darrin

Can anyone provide a quick step-by-step for porting a impactjs game (browser, not iOSimpact) to Ejecta?

1 decade ago by city41

Woot, thanks Dominic! This looks awesome. I also think you made the right choice in focusing on this instead of 2.0 for the time being. Impact 1 is already a solid engine, but a really great solution for iOS hadn't really emerged IMO yet.

When my game is done my main targets will be Windows and OSX, so if by then there is no desktop version of Ejecta, I will embark on forking and making one.

1 decade ago by TylerAppmobi

@city41

Not to discourage you from making your own desktop version, but awesomium is a cool company that allows HTML5 to be wrapped in a native container and deployed to the Mac store and can compile to an exe. Might be what you're looking for :)

http://awesomium.com/

1 decade ago by alexandre

Awesomium licensing costs 2900$ (one-time fee) per commercial app. They also offer an indie licensing scheme: free for any kind of work as long as your sales total less than 100,000$.

1 decade ago by city41

Aw sweet guys, thanks. I had looked around for an existing solution and didn't find any that quite met my needs (App.js, Titanium Desktop, etc). Awesomium does sound promising indeed.

1 decade ago by cancandan

Any help on running CAAT with Ejacta?

1 decade ago by Jerczu

Awesomium seem nice but recently LostDecade games guys released a tutorial on how to package your impactjs game to desktop using their onslaught arena as example... I can't find the full article now but I'll leave that to you http://www.lostdecadegames.com/

Why pay if you can do it for free right?

1 decade ago by fulvio

Just ported my iOSImpact game to Ejecta today.

What can I say, absolutely brilliant. I'm seeing a 5fps increase from 55fps.

I had to make some tweaks here and there since my game is using 100% pixel art:

canvas.imageSmoothingEnabled = false; (thanks @amadeus)
ig.Sound.channels = 2; (for some reason not setting this wouldn't load my game and I'm using MP3's for mobile)

Dom, you've done it again. Thanks a million and well done on this release.

1 decade ago by lazer

This sounds/looks so awesome. Can't wait to try it out.

1 decade ago by MrSpeaker

I'm completely blown away by this project - I just loaded it up, and had stuff running in seconds. I'd pretty much given up on canvas because of the crappy frame rates in the mobile browser and I'm so excited about what I can do now.

Thanks so much!

1 decade ago by fulvio

If people are having issues working out how to load their Impact games using Ejecta.

Ensure your index.js looks like this (where main.js is your main game file).
ejecta.require('lib/impact/impact.js');
ejecta.require('lib/game/main.js');

So essentially your App folder should look like this:
App/index.js
App/lib/game
App/lib/impact
App/lib/plugins
App/media
etc


Then within your main.js file your canvas load should look something similar to this:

// Setup the main canvas.
var height = 160;
var scale = window.innerHeight / height;
var width = window.innerWidth / scale;

ig.main('#canvas', MyGame, 60, width, height, 1);

All of this information can be accessed here.

1 decade ago by dominic

Thanks fulvio! I updated the documentation a bit, explaining the App/ folder: Integrating Impact Games.


Quote from Philip
But unfortunately I don't see that much of an performance boost. Buthe drawing isn't really the problem here, it's more on the logic side. Thanks to the new XCode and iOS 6 I discovered that today.

It's sad that Apple doesn't allow JIT…

Yeah, I wish they'd allow the JIT already; or make the JavaScriptCore API puplic in the first place, so we don't have to bundle the library with each game.

The version of the JavaScriptCore library that is included in Ejecta should still be a good deal faster than it was in iOSImpact. It now uses the new low level interpreter.

1 decade ago by Philip

Just tested the old Version again and it was slower than I remembered. So yeah, performance boost, woho!

1 decade ago by mkreitler

Dominic, this is brilliant! Thanks for taking the time to do it and thanks also for making it open source.

1 decade ago by Rob2

Very impressive - although not an Impact user I have been tinkering with ejecta and the performance is excellent.

Is there a bug with fill and stroke text? Both render a plain filled rectangle until a second use is made.

ctx.font = '16pt Arial';
ctx.fillStyle = '#131BF5';
ctx.fillText("My Text", 100,100);

Renders a blue rectangle at 100,100

ctx.font = '16pt Arial';
ctx.fillStyle = '#131BF5';
ctx.fillText("My Text", 100,100);
ctx.fillText("My Text", 200,100);

Renders My Text at 100,100 and a blue rectangle at 200,100

1 decade ago by dominic

@Rob2: are you on the latest version ( github)? I believe we fixed that problem a few days ago.

1 decade ago by Rob2

Thanks very much, that fixed it.

I'm tryng to use Ejecta with Construct2.

1 decade ago by fulvio

I just upgraded to the latest version of Ejecta.

I've noticed that the imageSmoothingEnabled line in my index.js isn't working with my pixel graphics anymore?

// Enable crisp nearest-neighbor scaling instead
// of the default bilinear scaling.
canvas.imageSmoothingEnabled = false;

ejecta.include('lib/impact/impact.js');
ejecta.include('lib/game/main.js');

My game looks all smooth and almost vector-based.

1 decade ago by mimik

@fulvio i had the same problem i just reverted the impact folder in the ejecta app somethings seams wrong there.
So just take a earlier impactjs version and overwrite.

1 decade ago by dominic

In the newest version on Github, imageSmoothingEnabled is an attribute of the canvas context, not the canvas itself. This was done to follow the spec more closely.

Put this in your Game's init() to make it work again:
ig.system.context.imageSmoothingEnabled = false;

1 decade ago by fulvio

Thanks @dominic, this works fine now.

The only issue I'm noticing now are my fonts look a little whacky and that the width and height on iPhone 5 is short (missing about 16 pixels).

This is how I'm managing it at the moment:

var height = window.innerHeight;
var width = window.innerWidth;

ig.main('#canvas', OxygeneTitle, 60, width, height, 1);

Perhaps there is a better way of detecting width and height for devices?

On another note if I'm using an old version of Ejecta with Impact 1.21 I receive this error:

TypeError: Attempted to assign to readonly property. at line 131 in lib/impact/system.js

In order to get it running on the device I had to remove the following code from lib/impact/system.js:

// Automatically switch to crisp scaling when using a scale
// other than 1
if( this.scale != 1 ) {
	ig.System.scaleMode = ig.System.SCALE.CRISP;
}
ig.System.scaleMode( this.canvas, this.context );

AND

ig.System.SCALE = {
	CRISP: function( canvas, context ) {
		ig.setVendorAttribute( context, 'imageSmoothingEnabled', false );
		canvas.style.imageRendering = '-moz-crisp-edges';
		canvas.style.imageRendering = '-o-crisp-edges';
		canvas.style.imageRendering = '-webkit-optimize-contrast';
		canvas.style.imageRendering = 'crisp-edges';
		canvas.style.msInterpolationMode = 'nearest-neighbor'; // No effect on Canvas :/
	},
	SMOOTH: function( canvas, context ) {
		ig.setVendorAttribute( context, 'imageSmoothingEnabled', true );
		canvas.style.imageRendering = '';
		canvas.style.msInterpolationMode = '';
	}
};
ig.System.scaleMode = ig.System.SCALE.SMOOTH;
Page 1 of 1
« first « previous next › last »