Exemplo n.º 1
0
 public DynamicBody(Body phys_body, Mesh fixture)
     : base(phys_body, fixture)
 {
     this.phys_body = phys_body;
     this.mesh = fixture;
     if (phys_body != null)
         this.phys_body.UserData = this;
 }
Exemplo n.º 2
0
 public Player(GameWindow window, Body phys_body, Mesh fixture)
     : base(phys_body, fixture)
 {
     window.KeyDown += KeyDown;
     window.KeyUp += KeyUp;
     phys_body.UserData = this;
     phys_body.OnCollision += phys_body_OnCollision;
     CollideWithAll = true;
 }
Exemplo n.º 3
0
 public Enemy(Body phys_body, Mesh fixture)
     : base(phys_body, fixture)
 {
     phys_body.OnCollision += phys_body_OnCollision;
     rotation = -1;
     phys_body.UserData = this;
     DestroyPlayer = true;
     IsMove = true;
     IsDestroyByTouching = false;
 }
Exemplo n.º 4
0
        public static bool IsLeft(Mesh first_fixture, Mesh second_fixture)
        {
            double x1, y1, x2, y2;
            x1 = first_fixture.rectangle.First.First;
            y1 = first_fixture.rectangle.First.Second;
            x2 = first_fixture.rectangle.Second.First;
            y2 = first_fixture.rectangle.Second.Second;

            double x3, y3, x4, y4;
            x3 = second_fixture.rectangle.First.First;
            y3 = second_fixture.rectangle.First.Second;
            x4 = second_fixture.rectangle.Second.First;
            y4 = second_fixture.rectangle.Second.Second;

            if (Compare(x2, x3) == -1 || Compare(x2, x4) == 0 && (Compare(y3, y2) == -1 || Compare(y1, y4) == -1))
                return true;
            return false;
        }
Exemplo n.º 5
0
 public Teleport(Body phys_body, Mesh fixture)
     : base(phys_body, fixture)
 {
     phys_body.OnCollision += phys_body_OnCollision;
     phys_body.UserData = this;
 }
Exemplo n.º 6
0
 public Block(Body phys_body, Mesh fixture)
     : base(phys_body, fixture)
 {
     phys_body.UserData = this;
 }
Exemplo n.º 7
0
 public Background(Body phys_body, Mesh fixture)
     : base(phys_body, fixture)
 {
 }
Exemplo n.º 8
0
 public StaticBody(Body phys_body, Mesh fixture)
 {
     this.phys_body = phys_body;
     this.mesh = fixture;
 }