public void Load(Player subby, LevelBoundaries boundaries) { Subby = subby; Boundaries = boundaries; }
private void UpdateScrollingPosition(Player subby, LevelBoundaries levelBoundaries) { ScrollingPosition += (int)subby.Position.X - (int)LevelBoundaries.Right; }
public void setup() { Player subby; subby = new Player() { Fuel = 1000, Speed = 0, AngleDegrees = 0, Position = new Vector2(0, 0), Bullits = 10, Health = 1000 }; level = new Level(); level.Subby = subby; levelboundaries = new LevelBoundaries() { Bottom = 200, Left = 10, Right = 200, Top = 10 }; level.LevelBoundaries = levelboundaries; level.ScrollingPosition = 0; wrak = new Wrak(); wrak.Damage = 1; wrak.Position = new Vector2(0, 0); }
public void SubbyOnLevelBounaries(Player subby) { if (subby.Position.Y > LevelBoundaries.Bottom - 3) { subby.Position -= subby.GetDamagedPositionBehavour(); } if (subby.Position.Y <= LevelBoundaries.Top || subby.Position.X <= LevelBoundaries.Left || subby.Position.Y >= LevelBoundaries.Bottom) { subby.Speed = -subby.Speed; } if (subby.Position.X >= LevelBoundaries.Right) { UpdateScrollingPosition(subby, LevelBoundaries); subby.Position = new Vector2(LevelBoundaries.Right, subby.Position.Y); } }