public Meteor(MeteorType meteorType, Point initialLocation) { IsActive = true; _meteorSprite = new Sprite(); _meteorType = meteorType; CreateMeteor(initialLocation); }
public void Activate() { _shipSprite = new Sprite(); _shipSprite.Polygon = new[] { new Point(0, 0), new Point(30, 0), new Point(30, 20), new Point(0, 20), new Point(0, 0)}; _startTime = DateTime.Now; _location = new Point(Constants.CanvasWidth, 60); }
public void Fire(Point startLocation, double direction, float maxDistance, PhotonTimeManager photoTimeManager) { _photonTimeManager = photoTimeManager; if(!EnoughTimeHasPassed()) return; _maxDistance = maxDistance; _distanceTraveled = 0; _bulletSprite = new Sprite(); _bulletSprite.Polygon = new[] { new Point(startLocation.X, startLocation.Y), new Point(startLocation.X+1, startLocation.Y+1), new Point(startLocation.X, startLocation.Y) }; _bulletSprite.Speed = Constants.BulletSpeed; _bulletSprite.TravelDirectionInDegrees = direction; _location = startLocation; _photonTimeManager.SetFired(); }
public PlayerShip() { _isActive = true; _shipSprite = new Sprite(); _shipSprite.TravelDirectionInDegrees = 30f; }
internal bool CollidesWith(Sprite sprite) { return sprite.Polygon.CollidesWith(this.Polygon); }