thanks for the hints. I set a "colliding" flag to ensure the call to
Heading() occurs
only once and verified it with a debug message which only shows up
once (see below).
Still - any call (Heading() or PaintColor() - doesn't matter - crashes
the app...
Hm...
Bernhard
public void CollidedWith(Sprite other) {
if(!this.colliding){
this.Heading(90);
this.colliding = true;
dbg("this.colliding="+this.colliding); //+" "+other.equals(racketSprite));
Thanks,
Lazeeb
public class PongBall extends Ball{
public PongBall(ComponentContainer container) {
super(container);
// TODO Auto-generated constructor stub
}
@Override
public void EdgeReached(int edge){
int randHeading = 90 + randomGen.nextInt(10);
this.Heading(this.Heading() + randHeading);
}
@Override
public void CollidedWith(Sprite other){
//causes application to crash!
this.Heading(90);
}
}