コード例 #1
0
ファイル: AmmoGib.cs プロジェクト: Thinny-Hendrix/MoonCow
        public AmmoGib(MoneyManager mon, Ship ship, Vector3 pos, Game1 game, int type)
            : base()
        {
            this.value = value;
            this.model = ModelLibrary.bombProjectile;
            this.pos = pos;
            this.ship = ship;
            this.game = game;
            this.type = type;
            moneyManager = mon;
            weps = ship.weapons;
            scale = new Vector3(.3f, .3f, .3f);

            setColor(type);

            glow = new MoneyGibGlow(TextureManager.square, this, game);
            game.modelManager.addEffect(glow);

            initDirection.X = (float)Utilities.random.NextDouble()*2-1;
            initDirection.Y = (float)Utilities.random.NextDouble()*2-1;
            initDirection.Z = (float)Utilities.random.NextDouble()*2-1;
            initDirection.Normalize();

            currentDirection = initDirection;

            rot = currentDirection;

            speed = Utilities.nextFloat()*5+17;
            changeDirectionSpeed = Utilities.nextFloat() + 4.5f;

            col = new CircleCollider(pos, 0.05f);
            collected = false;
        }
コード例 #2
0
ファイル: MoneyGib.cs プロジェクト: Thinny-Hendrix/MoonCow
        public MoneyGib(float value, Model model, MoneyManager moneyManager, Ship ship, Vector3 pos, Game1 game, int type)
            : base()
        {
            this.value = value;

            if (type == 4)
            {
                this.model = ModelLibrary.polyGib;
                scale = new Vector3(.15f, .15f, .15f);
            }
            else
            {
                this.model = model;
                scale = new Vector3(.03f, .03f, .03f);
            }

            this.pos = pos;
            this.moneyManager = moneyManager;
            this.ship = ship;
            this.game = game;

            setColor(type);

            glow = new MoneyGibGlow(TextureManager.square, this, game);
            game.modelManager.addEffect(glow);

            initDirection.X = (float)Utilities.random.NextDouble()*2-1;
            initDirection.Y = (float)Utilities.random.NextDouble()*2-1;
            initDirection.Z = (float)Utilities.random.NextDouble()*2-1;
            initDirection.Normalize();

            currentDirection = initDirection;

            rot = currentDirection;

            speed = Utilities.nextFloat()*5+17;
            changeDirectionSpeed = Utilities.nextFloat() + 4.5f;

            col = new CircleCollider(pos, 0.05f);
            collected = false;
        }