update method
Implementation
@override
void update() {
position.add(velocity);
if (position.x > area.width || position.x < 0) {
velocity = -velocity;
}
if (position.y > area.height || position.y < 0) {
velocity = -velocity;
}
}
@override
void update() {
position.add(velocity);
if (position.x > area.width || position.x < 0) {
velocity = -velocity;
}
if (position.y > area.height || position.y < 0) {
velocity = -velocity;
}
}