public bool Intersects(CollisionSphere sphere) { return(MyMath.Distance(this.Center, sphere.Center) < this.Radius + sphere.Radius); }
public void CollidedWith(IColloidableObject colloidableObject) { MyContentManager.Sound_Explosion.Play(Math.Max(0, 0.1f - MyMath.Distance(gameWorld.CameraPosition, gamePosition) / 4000.0f / 10)); gameWorld.Add(new BulletExplosion(gameWorld, gamePosition, Energy)); dead = true; }
public void RotataeAndMove(Vector2 velocity) { this.velocity = MyMath.LimitVelocity(velocity, 80f) / 5; Rotate(MyMath.GetAngle(velocity)); gamePosition += this.velocity; }