8 years ago by zouzouek
Help with the drop game example,
I'm trying to change the game size from [64,96] to [576,1024] and then scaling it with the scale command to each device. But i'm very lost with the scaling process. For example how to scale a player entity with the following
and therefore what is the correlation of x and y in size in accordance with the height and width.
Sorry for the high noob level, but i'm trying to wrap my head around the game world dimensions in impactjs.
I'm trying to change the game size from [64,96] to [576,1024] and then scaling it with the scale command to each device. But i'm very lost with the scaling process. For example how to scale a player entity with the following
EntityPlayer = ig.Entity.extend({ size: { x: 4, y: 4 }, checkAgainst: ig.Entity.TYPE.B, animSheet: new ig.AnimationSheet('media/player.png',4,4), maxVel: { x: 50, y: 300 }, friction: { x: 600, y: 0 }, speed: 300, bounciness: 0.5, sound: new ig.Sound('media/bounce.ogg'), init: function(x, y, settings) { this.addAnim('idle', 0.1, [0]); this.parent(x, y, settings); }, update: function() { if (ig.input.state('left')) { this.accel.x = -this.speed; } else if (ig.input.state('right')) { this.accel.x = this.speed; } else { this.accel.x = 0; } this.parent(); }, handleMovementTrace: function(res) { if (res.collision.y && this.vel.y > 32) { this.sound.play(); } this.parent(res); }, check: function(other) { other.pickup(); } });
and therefore what is the correlation of x and y in size in accordance with the height and width.
Sorry for the high noob level, but i'm trying to wrap my head around the game world dimensions in impactjs.