Actually I have my player entity with 64x64 sprite animation and 18x60 hitbox also the map is maded by 16x16 tiles. When my player goes some way he can pass through blocks (but not all of them). For example there are 4 situations:
Good (player can't pass the tile with isSolid property on collision layer)

Good (player can't pass the tile with isSolid property on collision layer)

Bad (player pass the tile with isSolid property on collision layer)

Bad (player pass the tile with isSolid property on collision layer)

Looks like melonJS checks only corners of hitbox instead of whole rectangle. Can anyone help me in this situation.
UPD: my PlayerEntity.
var PlayerEntity = me.ObjectEntity.extend({
init: function(x, y, settings) {
settings.image = "player";
settings.spritewidth = 64;
settings.spriteheight = 64;
this.parent(x, y, settings);
this.setVelocity(3, 10);
this.updateColRect(23, 18, 4, 60);
me.game.viewport.follow(this.pos, me.game.viewport.AXIS.BOTH);
this.direction = 'stand2';
this.addAnimation("run", [0,1,2,3,4,5,6,7,8,9]);
this.addAnimation("stand", [33]);
this.addAnimation("stand2", [44]);
this.addAnimation("jump", [29,29,29,29,29,29,29,29,27,27]);
this.addAnimation("jump2", [26,27,27,27,29,29,27,27,26]);
},
update: function() {
hadSpeed = this.vel.y != 0 || this.vel.x != 0 ;
if(hadSpeed)
this.animationspeed = me.sys.fps / 10;
if (me.input.isKeyPressed('left')) {
this.jumping ? this.setCurrentAnimation('jump2') : this.setCurrentAnimation('run');
this.flipX(false);
this.vel.x = -this.accel.x * me.timer.tick;
this.direction = 'left';
}
...
right/jump etc goes here
...
updated = this.updateMovement();
if (!hadSpeed) this.setCurrentAnimation('stand');
if (updated) this.parent(this);
return updated;
}
});
overlaps : function(r). Are you sure you marked the boxes as collide and not platform? Does onCollision get triggered on the sprite? Post your relevant code, the bug is most likely in your code or level, not in the framework. – Daniel Carlsson Oct 10 '12 at 14:55onCollision: function() {alert("collided")}and see if it gets triggered, and from what I saw you can mark blocks as platforms or solid, platform would allow you to enter them from the side or below and cause the problem. – Daniel Carlsson Oct 11 '12 at 0:44PlayerEntitybut it never triggered. Also all my blocks haveisSolidflag. I have no chance to change framwork code so I need somehow to ovveridecheckCollisionmethod (with proper logic) in myPlayerEntity. Also I found that it is an general bug for melonJs – Arthur Halma Oct 11 '12 at 6:24