Example #1
0
 public void Load(Player subby, LevelBoundaries boundaries)
 {
     Subby = subby;
     Boundaries = boundaries;
 }
Example #2
0
 private void UpdateScrollingPosition(Player subby, LevelBoundaries levelBoundaries)
 {
     ScrollingPosition += (int)subby.Position.X - (int)LevelBoundaries.Right;
 }
Example #3
0
        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);
        }
Example #4
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);
            }
        }