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 dexxa

can entity be created not using image but do something like
http://billmill.org/static/canvastutorial/ball.html

1 decade ago by dominic

Yes, just overwrite the draw method for your entity and draw your shapes:

EntityBall = ig.Entity.extend({

...
    
    draw: function() {
		var x = this.pos.x - this.offset.x - ig.game.screen.x;
		var y = this.pos.y - this.offset.y - ig.game.screen.y;

		//draw a circle
		ig.system.context.beginPath();
		ig.system.context.arc(x, y, 10, 0, Math.PI*2, true);
		ig.system.context.closePath();
		ig.system.context.fill();
    }
});

1 decade ago by Hazneliel

consider also multiplying x and y by ig.system.scale
Page 1 of 1
« first « previous next › last »