--
You received this message because you are subscribed to the Google Groups "excaliburjs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to excaliburjs...@googlegroups.com.
To post to this group, send email to excal...@googlegroups.com.
Visit this group at https://groups.google.com/group/excaliburjs.
To view this discussion on the web visit https://groups.google.com/d/msgid/excaliburjs/61564cc2-11e0-49ff-b286-fec82cbf1c31%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
But yes I have tried setting the collision types to active but it doesn't appear to change the behavior.
class Paddle extends ex.Actor {
public game: ex.Engine;
constructor(game: ex.Engine) {
super({
x: game.drawWidth / 2,
y: game.drawHeight - 40,
width: 200,
height: 20
});
// this.game = game;
// this.setWidth(200);
// this.setHeight(20);
// this.x = this.game.drawWidth / 2;
// this.y = this.game.drawHeight - 40;
this.color = ex.Color.Chartreuse;
this.collisionType = ex.CollisionType.Fixed;
this.addInputListener();
}
..
}
this.on('postupdate', (e) => {
if(this.pos.x < 0 || this.pos.y < 0 || this.pos.x > this.game.drawWidth || this.pos.y > this.game.drawHeight) {
alert('You lose!');
}
});
Yes, I've tried setting both the paddle and the ball to active but that doesn't appear to change any of the behavior or raise any collision events.Currently it's setup the same way as the breakout getting started project where the paddle is collisiontype fixed and the ball is passive but you handle the collision by registering an event handler on the precollision event.
--
You received this message because you are subscribed to the Google Groups "excaliburjs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to excaliburjs...@googlegroups.com.
To post to this group, send email to excal...@googlegroups.com.
Visit this group at https://groups.google.com/group/excaliburjs.
To view this discussion on the web visit https://groups.google.com/d/msgid/excaliburjs/32afe5e4-37f6-4114-9491-e4315dd6266c%40googlegroups.com.