Exemple #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;
 }
Exemple #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;
 }
Exemple #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;
 }
Exemple #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;
        }
Exemple #5
0
 public Teleport(Body phys_body, Mesh fixture)
     : base(phys_body, fixture)
 {
     phys_body.OnCollision += phys_body_OnCollision;
     phys_body.UserData = this;
 }
Exemple #6
0
 public Block(Body phys_body, Mesh fixture)
     : base(phys_body, fixture)
 {
     phys_body.UserData = this;
 }
Exemple #7
0
 public Background(Body phys_body, Mesh fixture)
     : base(phys_body, fixture)
 {
 }
Exemple #8
0
 public StaticBody(Body phys_body, Mesh fixture)
 {
     this.phys_body = phys_body;
     this.mesh = fixture;
 }