- Timestamp:
- 2016-07-02 23:37:37 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
2016/27/SimoR/SimplePhysicsTest/SimplePhysicsTest/SimplePhysicsTest/SimplePhysicsTest.cs
r7644 r7646 39 39 private bool walkRight; 40 40 41 //private double movement;42 43 41 public Enemy(double width, double height) : base(width, height) 44 42 { … … 47 45 public override void Update(Time time) 48 46 { 49 //if (movement == 0)50 // movement = -Speed;51 52 47 if (Game.Collisions(this, new Vector(2, 1), true).Count > 0) 53 48 walkRight = false; 54 //movement = -Speed;55 49 56 50 if (Game.Collisions(this, new Vector(-2, 1), true).Count > 0) 57 51 walkRight = true; 58 //movement = Speed;59 52 60 53 if (!FallOffPlatforms) … … 66 59 { 67 60 walkRight = false; 68 //movement = -Speed;69 61 } 70 62 if (Game.GetTileAt(Game.WorldToTilePosition(bottomLeft)) == null) 71 63 { 72 64 walkRight = true; 73 //movement = Speed; 74 } 75 } 76 77 //Velocity = new Vector(movement, Velocity.Y); 65 } 66 } 67 78 68 Walk(walkRight? Speed : -Speed); 79 69 base.Update(time);
Note: See TracChangeset
for help on using the changeset viewer.