1 decade ago by ansimuz
Hi,
I am having trouble making 2 fixed entities collide in the y axis.
I made a block entity that is pushable. but when i push it over another instance of the same object it falls ignoring the other block and even the collision map. See animation.
ig.module(
'game.entities.moving-block-test'
)
.requires(
'impact.entity'
)
.defines(function(){
EntityMovingBlockTest = ig.Entity.extend({
size: {x: 16, y:16},
isBlocked: false,
playerPosX: 0,
maxVel: {x: 10, y:99},
otherBlocksArr: null,
collides: ig.Entity.COLLIDES.FIXED,
type: ig.Entity.TYPE.B,
checkAgainst: ig.Entity.TYPE.BOTH,
animSheet: new ig.AnimationSheet( 'media/blocks.png', 16, 16 ),
init: function( x, y, settings ) {
this.parent( x, y, settings );
// Add the animations
this.addAnim( 'idle', 1, [0] );
},
receiveDamage: function(amount,from){
this.parent(0,this);
},
update: function() {
this.parent();
}
});
});
I am having trouble making 2 fixed entities collide in the y axis.
I made a block entity that is pushable. but when i push it over another instance of the same object it falls ignoring the other block and even the collision map. See animation.
ig.module(
'game.entities.moving-block-test'
)
.requires(
'impact.entity'
)
.defines(function(){
EntityMovingBlockTest = ig.Entity.extend({
size: {x: 16, y:16},
isBlocked: false,
playerPosX: 0,
maxVel: {x: 10, y:99},
otherBlocksArr: null,
collides: ig.Entity.COLLIDES.FIXED,
type: ig.Entity.TYPE.B,
checkAgainst: ig.Entity.TYPE.BOTH,
animSheet: new ig.AnimationSheet( 'media/blocks.png', 16, 16 ),
init: function( x, y, settings ) {
this.parent( x, y, settings );
// Add the animations
this.addAnim( 'idle', 1, [0] );
},
receiveDamage: function(amount,from){
this.parent(0,this);
},
update: function() {
this.parent();
}
});
});
