Exemplo n.º 1
0
 public Camera()
 {
     m_location = new LocationComponent(this);
     m_target = new FollowTargetComponent(this, m_location);
     m_restrictPosition = new RestrictLocationComponent(this, m_location);
     m_zoom = 1.0;
 }
Exemplo n.º 2
0
        public Bullet()
        {
            m_location = new LocationComponent(this);
            m_move = new MoveComponent(this, m_location);

            m_lifeTimeTotal = 0.5;
            m_lifeTime = m_lifeTimeTotal;
        }
Exemplo n.º 3
0
 public MoveComponent(Entity entity, LocationComponent location)
     : base(entity)
 {
     m_location = location;
     m_newLocation = Vector2.Zero;
     Direction = Vector2.Zero;
     Speed = 100;
 }
Exemplo n.º 4
0
        public Blood()
        {
            m_location = new LocationComponent(this);

            m_lifeTimeTotal = 0.5;
            m_lifeTime = m_lifeTimeTotal;
            m_neverDie = false;
            m_angle = 0f;
        }
Exemplo n.º 5
0
        public Ennemy()
        {
            m_location = new LocationComponent(this);
            m_move = new MoveComponent(this, m_location);
            m_rigidBody = new RigidBodyComponent(this, m_location);
            m_life = new LifeComponent(this, 50);

            var r = (byte)RandomGenerator.Instance.Random.Next(0, 255);
            var g = (byte)RandomGenerator.Instance.Random.Next(0, 255);
            var b = (byte)RandomGenerator.Instance.Random.Next(0, 255);
            m_bloodColor = new Color4ub(r, g, b, 255);
        }
Exemplo n.º 6
0
        public Shoot(Vector2 position, Vector2 direction, Color4ub startColor, Color4ub endColor, float angle = 2, float radius = 2)
        {
            m_location = new LocationComponent(this);
            m_location.SetPosition(position);

            m_cone = new Cone(
                position,
                radius,
                angle,
                startColor,
                endColor,
                (float)((Math.Atan2(direction.Y, direction.X) + Math.PI*2) - (angle / 2.0) - Math.PI*2)
                );

            m_lifeTimeTotal = 0.2;
            m_lifeTime = m_lifeTimeTotal;
        }
Exemplo n.º 7
0
        public FireCamp()
        {
            m_location = new LocationComponent(this);
            m_rigidBody = new RigidBodyComponent(this, m_location);
            m_renderer = new SpriteRenderer(FireSprites.Instance);
            m_box = new Vector2(48, 48);

            m_sequence = new SpriteSequence(
                FireSprites.Instance.Camp1,
                FireSprites.Instance.Camp2,
                FireSprites.Instance.Camp3,
                FireSprites.Instance.Camp4,
                FireSprites.Instance.Camp5
            );

            m_sequence.SpritesPerSecond = 7;

            SetSprite(m_renderer);
        }
Exemplo n.º 8
0
        public Player()
        {
            m_location = new LocationComponent(this);
            m_rigidBody = new RigidBodyComponent(this, m_location);
            m_move = new MoveComponent(this, m_location);
            m_life = new LifeComponent(this, 100);
            m_box = new Vector2(32, 32);
            m_weapons = new Dictionary<string, Weapon>();

            m_renderer = new SpriteRenderer(PlayerSprites.Instance);
            m_sprite = m_renderer.AddSprite(PlayerSprites.Instance.Front1);

            m_walkRightSequence = new SpriteSequence(
                PlayerSprites.Instance.Right1,
                PlayerSprites.Instance.Right2,
                PlayerSprites.Instance.Right3
            );

            m_walkLeftSequence = new SpriteSequence(
               PlayerSprites.Instance.Left1,
               PlayerSprites.Instance.Left2,
               PlayerSprites.Instance.Left3
               );

               m_walkFrontSequence = new SpriteSequence(
               PlayerSprites.Instance.Front1,
               PlayerSprites.Instance.Front2,
               PlayerSprites.Instance.Front3
               );

               m_walkBackSequence = new SpriteSequence(
               PlayerSprites.Instance.Back1,
               PlayerSprites.Instance.Back2,
               PlayerSprites.Instance.Back3
               );
        }
 public RestrictLocationComponent(Entity entity, LocationComponent location)
     : base(entity)
 {
     m_location = location;
 }
Exemplo n.º 10
0
 public Tree()
 {
     m_location = new LocationComponent(this);
     m_rigidBody = new RigidBodyComponent(this, m_location);
 }
 public FollowTargetComponent(Entity entity, LocationComponent location)
     : base(entity)
 {
     m_location = location;
 }
Exemplo n.º 12
0
 public RigidBodyComponent(Entity entity, LocationComponent location)
     : base(entity)
 {
     m_location = location;
     Velocity = new Vector2(0, 0);
 }