コード例 #1
0
ファイル: Projectile.cs プロジェクト: kubakista/Battle-City
        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;
        }
コード例 #2
0
ファイル: Tank.cs プロジェクト: kubakista/Battle-City
        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;
        }