public WaveProjectileModel(WaveProjectile projectile, Game1 game, int type)
            : base()
        {
            this.projectile = projectile;
            this.game = game;
            rTarg = new RenderTarget2D(game.GraphicsDevice, 256, 64);
            sb = new SpriteBatch(game.GraphicsDevice);
            model = ModelLibrary.shockWave;

            pos = projectile.pos;
            scale = new Vector3(0.2f);
            pulsePos = -64;
            ripplePos = 64;
            alpha = 1;

            switch(type)
            {
                default:
                    c1 = Color.White;
                    break;
                case 2:
                    c1 = Color.SeaGreen;
                    break;
                case 3:
                    c1 = Color.Red;
                    break;
            }
        }
Example #2
0
 public SpinParticle(Game1 game, int type)
 {
     this.game = game;
     pos = game.ship.pos;
     tex = TextureManager.spinGlow_d;
     model = TextureManager.square;
 }
Example #3
0
        public Minigame(Game1 game)
            : base(game)
        {
            this.game = game;
            manager = new MgManager(this, game);
            screen = new MgScreen(this, manager, game);
            manager.screen = screen;
            hudMg = game.hud.hudMg;

            active = false;

            successCount = 0;
            maxBeats = 12;
            maxDubs = 4;
            holdTime = 0;

            displayer = new MgDisplayer(this, manager, game);
            game.modelManager.addEffect(displayer);

            models = new MgModelManager(game, this);

            defaultInstance = new MgInstance(game, this);
            defaultInstance.generateNew();
            manager.loadInstance(defaultInstance);
            manager.reset();

            game.hud.expSelect.setMinigame(this);
            triggeredHelp = false;
        }
Example #4
0
 public ElecParticle(Vector3 pos, Game1 game, Color c1, Color c2)
     : base()
 {
     initialize(pos, game);
     this.c1 = c1;
     this.c2 = c2;
 }
Example #5
0
        public MainMenu(Game1 game)
            : base(game)
        {
            this.game = game;
            tutorial = false;
            sb = new SpriteBatch(game.GraphicsDevice);
            buttons = new List<MenuButton>();

            //buttons.Add(new MenuButton("start game", new Vector2(200, 300)));
            buttons.Add(new MenuButton("Select level", new Vector2(155, 800), 0, 38));
            buttons.Add(new MenuButton("How to Play", new Vector2(190, 860), 0, 38));
            buttons.Add(new MenuButton("level creator", new Vector2(225, 920), 0, 38));
            buttons.Add(new MenuButton("exit game", new Vector2(260, 980), 0, 38));
            //buttons.Add(new MenuButton("options", new Vector2(200, 500)));

            activeButton = 0;
            currentButton = buttons.ElementAt(activeButton);
            currentButton.activate();
            scale = (float)game.GraphicsDevice.Viewport.Bounds.Width / 1920.0f;
            buttonSwitchCooldown = 0;
            holdTime = 0;
            menuCircle = new MenuCircle();
            time = 0;

            foreach (MenuButton b in buttons)
            {
                b.push(true,true,true);
            }
        }
Example #6
0
        public FireParticle(Vector3 pos, Game1 game, float dist)
        {
            this.model = TextureManager.dirSquare;
            this.game = game;
            startPos = pos;
            scalef = Utilities.nextFloat() + .25f;

            direction.X = (float)Utilities.random.NextDouble() * 2 - 1;
            direction.Y = (float)Utilities.random.NextDouble() * 1.5f - .5f;
            direction.Z = (float)Utilities.random.NextDouble() * 2 - 1;
            direction.Normalize();

            startPos += direction * Utilities.nextFloat() / 2;

            goalPos = pos + direction * dist;
            speed = 4.5f + Utilities.nextFloat();
            alpha = 1;

            rTarg = new RenderTarget2D(game.GraphicsDevice, 128, 128);
            sb = new SpriteBatch(game.GraphicsDevice);

            game.GraphicsDevice.SetRenderTarget(rTarg);
            sb.Begin();
            sb.Draw(TextureManager.pyroFlame, Vector2.Zero, Color.Lerp(Color.Red, Color.White, Utilities.nextFloat()));
            sb.End();
            game.GraphicsDevice.SetRenderTarget(null);
        }
Example #7
0
 public ElecParticle(Vector3 pos, Game1 game)
     : base()
 {
     initialize(pos, game);
     c1 = Color.Aqua;
     c2 = Color.SeaGreen;
 }
        public BombCenterParticle(Game1 game, Vector3 pos, int type)
            : base()
        {
            this.game = game;
            this.pos = pos;
            alpha = 1;

            rot.Z = (float)Utilities.random.NextDouble() * MathHelper.Pi * 1.5f;

            if(type == 1)
            {
                tex = TextureManager.bombCenter;
                fScale = 0.7f;
            }
            else if (type == 3)
            {
                tex = TextureManager.bombCenter2;
                fScale = 1.2f;
            }
            else
            {
                tex = TextureManager.bombCenter;
                fScale = 1.2f;
            }
            model = TextureManager.square;
        }
Example #9
0
        public JunkShip(Game1 game, Vector3 pos)
        {
            this.game = game;
            this.pos = pos;
            minigame = game.minigame;
            instance = new MgInstance(game, minigame);
            ship = game.ship;
            dir.X = Utilities.nextFloat() * 2 - 1;
            dir.Z = Utilities.nextFloat() * 2 - 1;
            dir.Normalize();
            successAtActivate = -1;

            interactRange = new CircleCollider(this.pos + dir*4, 2);

            cols = new List<OOBB>();
            cols.Add(new OOBB(this.pos + dir * 1.5f, dir, 1, 4, dir));
            cols.Add(new OOBB(this.pos + dir * -1.5f, dir, 1, 4, -dir));
            cols.Add(new OOBB(this.pos + Vector3.Cross(dir, Vector3.Up) * -1.5f, dir, 1, 4, Vector3.Cross(-dir, Vector3.Up)));
            cols.Add(new OOBB(this.pos + Vector3.Cross(-dir, Vector3.Up) * -1.5f, dir, 1, 4, Vector3.Cross(dir, Vector3.Up)));

            col = new OOBB(this.pos+dir*1.5f, dir, 1, 4, dir);

            model = new JunkShipModel(this, game);
            game.modelManager.addObject(model);
            nodePos = new Vector2((int)((this.pos.X / 30) + 0.5f), (int)((this.pos.Z / 30) + 0.5f));

            destroying = false;
        }
Example #10
0
        public Sentry(Game1 game, EnemyManager manager, Vector3 pos)
        {
            this.game = game;
            this.manager = manager;
            this.pos = pos;
            ship = game.ship;

            wakeRange = new CircleCollider(pos, 30);
            sleepRange = new CircleCollider(pos, 40);
            col = new CircleCollider(pos, 1.5f);
            state = State.idle;
            prevState = state;

            model = new SentryModel(this, game);
            game.modelManager.addEnemy(model);

            targetDir = Vector3.Forward;
            eyeDir = targetDir;
            cannonDir = targetDir;
            cooldownTime = 2;
            emoteTime = 0;
            health = 25;
            agroFireCount = 0;

            triggeredTele = false;

            telegraph = new EnemyShotTelegraph(game, pos - targetDir*2, targetDir, 1);
            game.modelManager.addEffect(telegraph);

            nodePos = new Vector2((int)((pos.X / 30) + 0.5f), (int)((pos.Z / 30) + 0.5f));
        }
Example #11
0
        public Projectile(Vector3 pos, Vector3 direction, Game1 game, Weapon weapon, int type)
        {
            this.direction = direction;
            this.game = game;
            this.pos = pos;
            this.rot.Y = (float)Math.Atan2(direction.X, direction.Z);
            this.weapon = weapon;
            this.type = type;

            speed = 50;
            life = 300;
            delete = false;
            damage = 5;

            col = new CircleCollider(pos, 0.2f);

            boundingBox = new OOBB(pos, direction, 0.3f, 1); // Need to be changed to be actual projectile dimensions

            if(type == 1)
            //            model = new ProjectileModel(this, TextureManager.elecRound64, TextureManager.elecRound64, TextureManager.elecTrail64, Color.Magenta, Color.Purple, game);
                model = new ProjectileModel(ModelLibrary.projectile, pos, this, Color.Green, Color.CornflowerBlue, game);
            else if(type == 0)
                model = new ProjectileModel(ModelLibrary.projectile, pos, this, Color.Orange, Color.Purple, game);
            else
                model = new ProjectileModel(ModelLibrary.projectile, pos, this, new Color(255,0,255), Color.Green, game);

            game.modelManager.addEffect(model);
        }
Example #12
0
 public BloomComponent(Game1 game)
     : base(game)
 {
     this.game = game;
     if (game == null)
         throw new ArgumentNullException("game");
 }
Example #13
0
 public AudioManager(Game1 game)
     : base(game)
 {
     this.game = game;
     soundEffects = new List<DisposableSoundEffect>();
     sToDelete = new List<DisposableSoundEffect>();
 }
Example #14
0
        public MgScreen(Minigame minigame, MgManager manager, Game1 game)
        {
            this.game = game;
            this.minigame = minigame;
            this.manager = manager;
            font = manager.font;

            overlay = game.Content.Load<Texture2D>(@"Minigame/mgOverlay");
            cross = game.Content.Load<Texture2D>(@"Minigame/mgX");

            rTarg = new RenderTarget2D(game.GraphicsDevice, 1365, 1024);
            sb = new SpriteBatch(game.GraphicsDevice);

            blue = new Color(200, 250, 255);
            red = new Color(249, 59, 43);

            particles = new List<SpriteParticle>();
            pToDelete = new List<SpriteParticle>();
            frontParticles = new List<SpriteParticle>();

            messages = new List<MgMessage>();
            mToDelete = new List<MgMessage>();

            moneyDesc = "Money earned:";
            displayMoney = 0;
        }
Example #15
0
        public Map(Game1 game, int[,] newMap)
        {
            mapSize = new Vector2(newMap.GetLength(0), newMap.GetLength(1));
            map = new MapNode[(int)mapSize.X, (int)mapSize.Y];

            //Generate array of mapNodes from int array
            //As each node is created, it's position and traversable values must be set
            //The model data will also need to bet set for each node here

            for(int y = 0; y < mapSize.Y; y++)
            {
                for (int x = 0; x < mapSize.X; x++)
                {
                    map[x, y] = new MapNode(game, newMap[x, y], new Vector2(x,y));

                    //add enemy spawn points to a list for easy access
                    if(newMap[x,y] == 7 || newMap[x,y] == 8 ||
                        newMap[x, y] == 9 || newMap[x, y] == 10)
                    {
                        enemySpawn.Add(new Vector2(x, y));
                    }

                    if (newMap[x, y] == 24)
                    {
                        coreLocation = new Vector2(x, y);
                    }
                }
            }

            linkNeighbors();
            game.asteroidManager.generateField();
            game.hud.hudMap.minimap.drawMap(map);
        }
Example #16
0
        public SpawnVortex(Vector3 pos, Vector3 rot, Game1 game)
            : base()
        {
            this.pos = pos;
            this.rot = rot;
            this.game = game;
            model = ModelLibrary.vortex;
            tex = game.Content.Load<Texture2D>(@"Models/Enemies/SpawnPoint/spiraltest");
            scale = new Vector3(0.8f,0.8f,0.7f);

            SkinningData skinningData = ModelLibrary.vortex.Tag as SkinningData;

            if (skinningData == null)
                throw new InvalidOperationException
                    ("This model does not contain a SkinningData tag.");

            // Create an animation player, and start decoding an animation clip.
            animPlayer = new AnimationPlayer(skinningData);

            animClip = skinningData.AnimationClips["Take 001"];

            animPlayer.StartClip(animClip);

            SetupEffects();

            sb = new SpriteBatch(game.GraphicsDevice);
            targ1 = new RenderTarget2D(game.GraphicsDevice, 1024, 1024);
            targ2 = new RenderTarget2D(game.GraphicsDevice, 1024, 1024);
            texPos = Vector2.Zero;
        }
Example #17
0
 public HudZoom(Hud hud, Game1 game)
 {
     this.hud = hud;
     this.game = game;
     alpha = 0;
     maxScale = 0.1f;
 }
Example #18
0
        public SentryModel(Sentry sentry, Game1 game)
            : base()
        {
            this.sentry = sentry;
            this.game = game;

            pos = sentry.pos;
            scale = new Vector3(0.2f);

            model = ModelLibrary.sentry;
            bodyTex = TextureManager.sentryBod;
            visorTex = TextureManager.sEye3;

            ant = model.Bones["anten"];
            topCap = model.Bones["topCap"];
            visor = model.Bones["visor"];
            midCap = model.Bones["midCap"];
            canRot = model.Bones["cannonRound"];
            cannon = model.Bones["cannon"];
            botCap = model.Bones["botCap"];

            topOffset = Vector3.Zero;
            tiltRot = 0;
            spinRot = 0;
        }
Example #19
0
 public BaseCore(Game1 game)
     : base(game)
 {
     this.game = game;
     maxHealth = 500;
     health = maxHealth;
 }
Example #20
0
        public HudMg(Hud hud, SpriteFont font, Game1 game)
            : base(hud, font, game)
        {
            active = false;

            updateText();
        }
Example #21
0
        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;
        }
Example #22
0
 public CoreRing(Vector3 pos, Game1 game)
 {
     this.pos = pos;
     this.pos.Y += 4.5f;
     this.game = game;
     fScale = 0.4f;
     model = TextureManager.square;
 }
        public ShipHealthSystem(Game1 game, Ship ship)
            : base(game)
        {
            this.game = game;
            this.ship = ship;

            reset();
        }
Example #24
0
 public LcSaveButton(Game1 game, Vector2 pos, LevelCreator lc)
 {
     this.pos = pos;
     this.game = game;
     this.lc = lc;
     bounds = new AABB(pos, 188, 71);
     checkTex();
 }
Example #25
0
 public Asteroid(Vector3 pos, Game1 game)
 {
     this.pos = pos;
     this.game = game;
     manager = game.asteroidManager;
     Random rng = Utilities.random;
     dir = Vector3.Zero;
     moveSpeed = 0f;
 }
Example #26
0
        public PyroTurretModel(Turret turret, Game1 game)
            : base(turret, game)
        {
            model = ModelLibrary.turretPyro;

            bodyMat = new Vector3(0, 1.45f, 0);

            barrelMat = new Vector3(1, 1.87f, 0);
        }
Example #27
0
 public SpeedCylModel(Model model, Ship ship, Game1 game)
     : base(model)
 {
     this.model = model;
     this.ship = ship;
     this.game = game;
     scale = new Vector3(100, 100, 100);
     offset = -25;
 }
Example #28
0
 public Weapon(WeaponSystem wepSys, Ship ship, Game1 game)
 {
     this.wepSys = wepSys;
     this.ship = ship;
     this.game = game;
     cooldown = 0;
     level = 1;
     projectiles = new List<Projectile>();
     toDelete = new List<Projectile>();
 }
Example #29
0
        int type; //0 is x, 1 is y

        #endregion Fields

        #region Constructors

        public LcGridModifier(Game1 game, Vector2 pos, LevelCreator lc, bool add, int type)
        {
            this.pos = pos;
            this.game = game;
            this.lc = lc;
            this.add = add;
            this.type = type;
            bounds = new AABB(pos, 30, 30);
            setTex();
        }
Example #30
0
        public HudPrompt(Hud hud, Game1 game, SpriteFont font)
        {
            this.hud = hud;
            this.game = game;
            this.font = font;
            pos = new Vector2(960, 350);

            promptFill = game.Content.Load<Texture2D>(@"Hud/promptFill");
            promptOut = game.Content.Load<Texture2D>(@"Hud/promptOut");
        }