Пример #1
0
 public Item(Vector2 spawnPosition, Texture2D texture)
 {
     position         = spawnPosition;
     dimensions       = new Vector2(64, 64); //temp (tilesize)
     this.texture     = texture;
     collisionManager = new ItemCollisionHandler(new Rectangle((int)position.X, (int)position.Y, (int)dimensions.X, (int)dimensions.Y));
 }
Пример #2
0
 public Bullet(Vector2 _pos, float _angle, float _speed, Texture2D _texture, TileMap tileMap)
 {
     texture          = _texture;
     position         = _pos;
     angle            = _angle;
     speed            = _speed;
     collisionHandler = new BulletCollisionHandler(tileMap);
     direction        = new Vector2((float)Math.Cos(angle), (float)Math.Sin(angle));
     direction.Normalize();
 }
Пример #3
0
 public WeaponHandler()
 {
     collisionManager = new CollisionHandler();
     isEquiped        = false;
 }
Пример #4
0
 public void UpdateCollisionBounds()
 {
     collisionManager = new ItemCollisionHandler(new Rectangle((int)position.X, (int)position.Y, (int)dimensions.X, (int)dimensions.Y));
 }
Пример #5
0
 public PhysicsHandler(CollisionHandler collisionManager)
 {
     this.collisionManager = collisionManager;
 }