public Jumper() { Collision = CollisionType.A; MaxVelocity = new Vector2 { X = 300, Y = 450 }; Animations = new AnimationSheet( @"Textures\player", 64, 64 ); Animations.Add( "idle", 1f, true, 0, 1 ); Animations.Add( "run", 0.07f, true, 12, 13, 14, 15, 16, 17, 18, 19, 20 ); Animations.Add( "jump", 0.09f, false, 21, 22 ); Animations.Add( "wallSlide", 1f, true, 2 ); Index = PlayerIndex.One; // our player only has horizontal friction Friction = new Vector2( 2000, 0 ); Settings[ "_feDrawBox" ] = "true"; BoundingBox = new HitBox { Height = 64, Width = 64 }; }
public void CanBe_SubtractedWith_Rectangle() { Rectangle rectangle = new Rectangle(0, 0, 100, 50 ); _box.Height = 100; _box.Width = 200; _box -= rectangle; Assert.Equal( 50, rectangle.Height ); Assert.Equal( 100, rectangle.Width ); }
public void CanBe_SubtractedWith_Vector2() { var vector = new Vector2( 100, 50 ); _box.Height = 100; _box.Width = 200; _box -= vector; Assert.Equal( 50, _box.Height ); Assert.Equal( 100, _box.Width ); }
public void CanBe_AddedWith_Rectangle() { Rectangle rectangle = new Rectangle(0, 0, 200, 100); _box.Height = 100; _box.Width = 200; _box += rectangle; Assert.Equal( 100, rectangle.Height ); Assert.Equal( 200, rectangle.Width ); }
public void CanBe_AddedWith_Vector2() { var vector = new Vector2( 200, 100 ); Assert.Equal( 0, _box.Height ); Assert.Equal( 0, _box.Width ); _box += vector; Assert.Equal( 100, _box.Height ); Assert.Equal( 200, _box.Width ); }
public HitBoxTests() { _box = new HitBox(); }
public void ShouldBe_AssignableFrom_Rectangle() { var rectangle = new Rectangle( 0, 0, 200, 100 ); _box = (HitBox)rectangle; Assert.Equal( 100, _box.Height ); Assert.Equal( 200, _box.Width ); }
public void ShouldBe_AssignableFrom_Vector2() { var vector = new Vector2( 200, 100 ); _box = (HitBox)vector; Assert.Equal( 100, _box.Height ); Assert.Equal( 200, _box.Width ); }