Beispiel #1
0
 public function setAngle($angle)
 {
     $this->angle = $angle * M_PI / 180;
     $cannon_x = $this->position->x + $this->body->radius * cos($this->angle);
     $cannon_y = $this->position->y - $this->body->radius * sin($this->angle);
     $this->cannon->setCenter(new Point($cannon_x, $cannon_y));
 }