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; }
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; }
public Ship(Game1 game) : base(game) { this.game = game; lastNodePos = Vector2.Zero; pos = new Vector3(90, 4.5f, 0); moveSpeed = 0; accel = 0.5f; maxSpeed = 0.2f; boostSpeed = 0.6f; direction = new Vector3(0, 0, -1); currentTurnSpeed = 0; maxTurnSpeed = MathHelper.PiOver4 / 30; boundingBox = new OOBB(pos, direction, 1.5f, 1.5f); // Need to be changed to be actual ship dimentions circleCol = new CircleCollider(pos, 0.75f); shipModel = new ShipModel(this, game); //shipModel = new ShipModel(game.Content.Load<Model>(@"Models/Enemies/Cubes/guncube"), this); skyboxModel = new SkyboxModel(game.Content.Load<Model>(@"Models/Misc/Skybox/skybox"), this); speedCyl = new SpeedCylModel(game.Content.Load<Model>(@"Models/Misc/speedCyl"), this, ((Game1)Game)); rbowTun = new RainbowTunnelModel(game.Content.Load<Model>(@"Models/Misc/Rbow/rbowTun"), this, ((Game1)Game)); game.modelManager.addObject(shipModel); game.modelManager.add(skyboxModel); game.modelManager.addObject(rbowTun); game.modelManager.addTransparent(speedCyl); weapons = new WeaponSystem(this, this.game); moneyManager = new MoneyManager(this.game); particles = new ShipParticleSystem(this.game, this); shipHealth = new ShipHealthSystem(this.game, this); game.Components.Add(weapons); game.Components.Add(moneyManager); game.Components.Add(particles); game.Components.Add(shipHealth); ((WeaponDrill)weapons.weapons.ElementAt(4)).dome.setShip(this); alive = true; }