Пример #1
0
        public Unit_Projectile(Game game, SpriteBatch spriteBatch, Unit_Animated_Player player, int level, int projAngle)
            : base(game, spriteBatch)
        {
            // level refers to projectile level, NOT game level

            // type of projectile
            int type = (int)MathHelper.Clamp(level, 0, 3);
            icon = content.Load<Texture2D>("B_" + type);

            angle = projAngle;
            damage = Settings.Projectile_DamageConstant + level * (int)Settings.Projectile_DamageMultiplier;

            position = new Vector2(player.Position.X + (player.Width - Width) / 2, player.Position.Y - Height);
            speed = Settings.Projectile_SpeedConstant + type * Settings.Projectile_SpeedMultiplier;
        }
Пример #2
0
        public Unit_Projectile(Game game, SpriteBatch spriteBatch, Unit_Animated_Player player, int level, int projAngle)
            : base(game, spriteBatch)
        {
            // level refers to projectile level, NOT game level

            // type of projectile
            int type = (int)MathHelper.Clamp(level, 0, 3);

            icon = content.Load <Texture2D>("B_" + type);

            angle  = projAngle;
            damage = Settings.Projectile_DamageConstant + level * (int)Settings.Projectile_DamageMultiplier;

            position = new Vector2(player.Position.X + (player.Width - Width) / 2, player.Position.Y - Height);
            speed    = Settings.Projectile_SpeedConstant + type * Settings.Projectile_SpeedMultiplier;
        }