Example #1
0
        public Projectile(Vector2 area, Texture2D texture, Vector2 position, Orientation orientation, float rotation, float moveSpeed, int damage)
        {
            this.area			=	area;
            this.Texture		=	texture;
            this.Position		=	position;
            this.orientation	=	orientation;
            this.rotation		=	rotation;
            this.MoveSpeed		=	moveSpeed;
            this.Damage			=	damage;

            this.Active	=	true;
        }
Example #2
0
        public void Initialize(Vector2 area, Texture2D tankTexture, Texture2D prTexture, Position pos)
        {
            //
            this.area		=	area;
            this.texture	=	tankTexture;
            this.prjTexture	=	prTexture;

            // pozice
            this.Position.X	=	pos.col * Wall.width + Wall.width;
            this.Position.Y	=	pos.row * Wall.height + Wall.height;

            this.origin.X	=	this.texture.Width / 2;
            this.origin.Y	=	this.texture.Height / 2;

            this.Orientation	=	new Orientation(0, -1);

            // střely
            this.Projectiles		=	new List<Projectile>();
            this.ProjectilesCount	=	1;
            this.ProjectilesSpeed	=	Projectile.moveSpeed;
            this.ProjectilesDamage	=	Projectile.damage;

            this.Active		=	true;

            this.MoveSpeed	=	Tank.moveSpeed;
            this.Health		=	Tank.health;

            Random random	=	new Random();
            this.Direction	=	random.Next(0, 1);

            this.Collision	=	false;
        }