public BulletNPC(Position basePosition, double angle, int x, int y): base(x, y) { this.basePosition = basePosition; this.angle = angle; this.image = new BitmapImage(); this.brush = setBrush(); this.Size = 20; }
public async void addToLastPositions(Position p) { await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.High, () => { // Remember 3 last positions and throw away first added item if (LastPositions.Count >= 4) LastPositions.RemoveAt(0); // Add the next position LastPositions.Add(p); // Set size relative to order moved in for (int counter = 1; counter < LastPositions.Count; counter++) LastPositions[counter].Size = 25 - (5 * counter); Changed("LastPositions"); }); }
public void move(int angle) { double x = (double)(Position.X + Speed * Math.Cos(angle)); double y = (double)(Position.Y + Speed * Math.Sin(angle)); Position = new Position(x, y); }
private void addToPointGains(Position p, int value) { PointGains.Add(new Tuple<Position, int, int>(p, value, 0)); }