Esempio n. 1
0
        public TitleScreen(ADHDGame g, SpriteBatch spb)
            : base(g, spb)
        {
            RobotActions.Instance.energy = 20;
            paper         = false;
            mouse         = false;
            game          = g;
            sb            = spb;
            titleSequence = new List <Texture2D>(40);
            gs            = new GameplayScreen(g, spb);
            titleAnim     = new Animation(new Rectangle(0, 0, 1024, 768), 40, 30, true);
            introNews     = g.Content.Load <Texture2D>("newspaper_intro");
            space         = g.Content.Load <Texture2D>("spaceBG");
            int i;

            for (i = 0; i < 40; i++)
            {
                titleSequence.Add(g.Content.Load <Texture2D>("titlescreen\\titlescreen" + (i + 1).ToString()));
            }
            snoring = g.Content.Load <SoundEffect>("Snoring").CreateInstance();
            alarm   = g.Content.Load <SoundEffect>("alarm_02").CreateInstance();

            alarm.IsLooped   = true;
            alarm.Volume     = 0.2f;
            snoring.IsLooped = true;
            snoring.Play();
        }
Esempio n. 2
0
        public Robot(ADHDGame g, Stage st)
        {
            //init anims
            right     = new Animation(new Rectangle(0, 206, Size.X, Size.Y), 9, rate, true);
            up        = new Animation(new Rectangle(0, 103, Size.X, Size.Y), 9, rate, true);
            down      = new Animation(new Rectangle(0, 0, Size.X, Size.Y), 9, rate, true);
            banjo     = new Animation(new Rectangle(0, 618, Size.X, Size.Y), 9, 1.0f / 10.0f, false);
            banjoPlay = new Animation(new Rectangle(0, 721, Size.X, Size.Y), 9, 1.0f / 10.0f, true);
            die       = new Animation(new Rectangle(0, 824, Size.X, Size.Y), 9, 1.0f / 10.0f, false);
            pushDown  = new Animation(new Rectangle(0, 309, Size.X, Size.Y), 9, 1.0f / 20.0f, false);
            pushUp    = new Animation(new Rectangle(0, 412, Size.X, Size.Y), 9, 1.0f / 20.0f, false);
            pushRight = new Animation(new Rectangle(0, 515, Size.X, Size.Y), 9, 1.0f / 20.0f, false);

            tex      = g.Content.Load <Texture2D>("robot");
            batch    = st.batch;
            stage    = st;
            position = Stage.TileToPos(new Point(11, 17));
            currAnim = down;
            currAnim.Stop();
            Dir      = Direction.Down;
            velocity = Vector2.Zero;
            flip     = SpriteEffects.None;
            game     = g;
            SnapToTile();
        }
Esempio n. 3
0
        public Robot(ADHDGame g, Stage st)
        {
            //init anims
            right = new Animation(new Rectangle(0, 206, Size.X, Size.Y), 9, rate, true);
            up = new Animation(new Rectangle(0, 103, Size.X, Size.Y), 9, rate, true);
            down = new Animation(new Rectangle(0, 0, Size.X, Size.Y), 9, rate, true);
            banjo = new Animation(new Rectangle(0, 618, Size.X, Size.Y), 9, 1.0f / 10.0f, false);
            banjoPlay = new Animation(new Rectangle(0, 721, Size.X, Size.Y), 9, 1.0f / 10.0f, true);
            die = new Animation(new Rectangle(0, 824, Size.X, Size.Y), 9, 1.0f / 10.0f, false);
            pushDown = new Animation(new Rectangle(0, 309, Size.X, Size.Y), 9, 1.0f / 20.0f, false);
            pushUp = new Animation(new Rectangle(0, 412, Size.X, Size.Y), 9, 1.0f / 20.0f, false);
            pushRight = new Animation(new Rectangle(0, 515, Size.X, Size.Y), 9, 1.0f / 20.0f, false);

            tex = g.Content.Load<Texture2D>("robot");
            batch = st.batch;
            stage = st;
            position = Stage.TileToPos(new Point(11, 17));
            currAnim = down;
            currAnim.Stop();
            Dir = Direction.Down;
            velocity = Vector2.Zero;
            flip = SpriteEffects.None;
            game = g;
            SnapToTile();
        }
Esempio n. 4
0
 public GameplayScreen(ADHDGame g, SpriteBatch spb)
     : base(g, spb)
 {
     sb         = spb;
     space      = g.Content.Load <Texture2D>("spaceBG");
     hudEnabled = true;
 }
Esempio n. 5
0
 public HoverDolly(ADHDGame g, SpriteBatch sb, Texture2D t, Vector2 position)
     : base(g, sb, t, position, new Rectangle(0, 384, 64, 64), 3, 1.0f / 3.0f, true, 1)
 {
     pos = position;
     vel = new Vector2(0, 0);
     tex = t;
 }
Esempio n. 6
0
        public TitleScreen(ADHDGame g, SpriteBatch spb)
            : base(g,spb)
        {
            RobotActions.Instance.energy = 20;
            paper = false;
            mouse = false;
            game = g;
            sb = spb;
            titleSequence = new List<Texture2D>(40);
            gs = new GameplayScreen(g, spb);
            titleAnim = new Animation(new Rectangle(0, 0, 1024, 768), 40, 30, true);
            introNews = g.Content.Load<Texture2D>("newspaper_intro");
            space = g.Content.Load<Texture2D>("spaceBG");
            int i;
            for (i = 0; i < 40; i++)
            {
                titleSequence.Add(g.Content.Load<Texture2D>("titlescreen\\titlescreen" + (i+1).ToString()));
            }
            snoring = g.Content.Load<SoundEffect>("Snoring").CreateInstance();
            alarm = g.Content.Load<SoundEffect>("alarm_02").CreateInstance();

            alarm.IsLooped = true;
            alarm.Volume = 0.2f;
            snoring.IsLooped = true;
            snoring.Play();
        }
Esempio n. 7
0
        public EndScreen(ADHDGame g, SpriteBatch spb, Ending e)
            : base(g, spb)
        {
            end = e;
            sb = spb;
            game = g;
            banjoEnd = game.Content.Load<Texture2D>("newspaper_death01");
            space = game.Content.Load<Texture2D>("spaceBG");
            explosion = game.Content.Load<SoundEffect>("Explosion").CreateInstance();
            airlockEnd = game.Content.Load<Texture2D>("newspaper_death02");
            blackhole = game.Content.Load<Texture2D>("newspaper_death03");
            breaks = game.Content.Load<Texture2D>("newspaper_death04");
            thrusters = game.Content.Load<Texture2D>("newspaper_death05");
            tutorial = game.Content.Load<Texture2D>("tutorial");
            inactive = game.Content.Load<Texture2D>("newspaper_death06");
            dub = game.Content.Load<Texture2D>("newspaper_death07");
            help = game.Content.Load<Texture2D>("newspaper_death08");

            explosion.Play();

            if (e != Ending.Banjo)
            {
                MediaPlayer.Play(game.Content.Load<Song>("SpaceRock_V1"));
            }
        }
Esempio n. 8
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (ADHDGame game = new ADHDGame())
     {
         game.Run();
     }
 }
Esempio n. 9
0
 public GameplayScreen(ADHDGame g, SpriteBatch spb)
     : base(g,spb)
 {
     sb = spb;
     space = g.Content.Load<Texture2D>("spaceBG");
     hudEnabled = true;
 }
Esempio n. 10
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (ADHDGame game = new ADHDGame())
     {
         game.Run();
     }
 }
Esempio n. 11
0
        public GuiHUD(ADHDGame game, SpriteBatch sb)
        {
            g = game;
            actionBtns = new List<GuiButton>(15);
            upBtns = new List<Texture2D>(15);
            downBtns = new List<Texture2D>(15);
            hoverBtns = new List<Texture2D>(15);
            int i;
            sidebar = g.Content.Load<Texture2D>("GuiButton\\SideMenu");
            energyBtn = g.Content.Load<Texture2D>("GuiButton\\EmptyButton");
            energy = g.Content.Load<Texture2D>("GuiButton\\EnergyBlip");
            for(i = 0; i<9; i++)
            {
                upBtns.Add(g.Content.Load<Texture2D>("GuiButton\\UpBtn\\UpBtn" + i.ToString()));
                downBtns.Add(g.Content.Load<Texture2D>("GuiButton\\DownBtn\\DownBtn" + i.ToString()));
                hoverBtns.Add(g.Content.Load<Texture2D>("GuiButton\\HoverBtn\\HoverBtn" + i.ToString()));

                //actionBtns.Add(new GuiButton(upBtns[i], downBtns[i], hoverBtns[i], new Vector2(0, 48 * i + 24)));
            }
            actionBtns.Add(new GuiButton(upBtns[0], downBtns[0], hoverBtns[0], Keys.W, new Vector2(10, 21)));
            actionBtns.Add(new GuiButton(upBtns[1], downBtns[1], hoverBtns[1], Keys.S, new Vector2(10, 21 + 48)));
            actionBtns.Add(new GuiButton(upBtns[2], downBtns[2], hoverBtns[2], Keys.A, new Vector2(10, 48 * 2 + 21)));
            actionBtns.Add(new GuiButton(upBtns[3], downBtns[3], hoverBtns[3], Keys.D, new Vector2(10, 48 * 3 + 21)));//end move
            actionBtns.Add(new GuiButton(upBtns[4], downBtns[4], hoverBtns[4], Keys.E, new Vector2(10, 48 * 4 + 21)));//
            actionBtns.Add(new GuiButton(upBtns[5], downBtns[5], hoverBtns[5], Keys.Q, new Vector2(10, 48 * 5 + 21)));//
            actionBtns.Add(new GuiButton(upBtns[6], downBtns[6], hoverBtns[6], Keys.R, new Vector2(10, 48 * 6 + 21)));//
            actionBtns.Add(new GuiButton(upBtns[7], downBtns[7], hoverBtns[7], Keys.F, new Vector2(10, 48 * 7 + 21)));//
            actionBtns.Add(new GuiButton(upBtns[8], downBtns[8], hoverBtns[8], Keys.V, new Vector2(10, 48 * 8 + 21)));
               // actionBtns.Add(new GuiButton(upBtns[9], downBtns[9], hoverBtns[9], Keys.Z, new Vector2(10, 48 * 9 + 21)));
               // actionBtns.Add(new GuiButton(upBtns[10], downBtns[10], hoverBtns[10], Keys.X, new Vector2(10, 48 * 10 + 21)));//
               // actionBtns.Add(new GuiButton(upBtns[11], downBtns[11], hoverBtns[11], Keys.C, new Vector2(10, 48 * 11 + 21)));//
               // actionBtns.Add(new GuiButton(upBtns[12], downBtns[12], hoverBtns[12], Keys.T, new Vector2(10, 48 * 12 + 21)));//
            //actionBtns.Add(new GuiButton(upBtns[13], downBtns[13], hoverBtns[13], Keys.G, new Vector2(10, 48 * 13 + 21)));//
               // actionBtns.Add(new GuiButton(upBtns[14], downBtns[14], hoverBtns[14], Keys.B, new Vector2(10, 48 * 14 + 21)));//
        }
Esempio n. 12
0
        public EndScreen(ADHDGame g, SpriteBatch spb, Ending e)
            : base(g, spb)
        {
            end        = e;
            sb         = spb;
            game       = g;
            banjoEnd   = game.Content.Load <Texture2D>("newspaper_death01");
            space      = game.Content.Load <Texture2D>("spaceBG");
            explosion  = game.Content.Load <SoundEffect>("Explosion").CreateInstance();
            airlockEnd = game.Content.Load <Texture2D>("newspaper_death02");
            blackhole  = game.Content.Load <Texture2D>("newspaper_death03");
            breaks     = game.Content.Load <Texture2D>("newspaper_death04");
            thrusters  = game.Content.Load <Texture2D>("newspaper_death05");
            tutorial   = game.Content.Load <Texture2D>("tutorial");
            inactive   = game.Content.Load <Texture2D>("newspaper_death06");
            dub        = game.Content.Load <Texture2D>("newspaper_death07");
            help       = game.Content.Load <Texture2D>("newspaper_death08");

            explosion.Play();

            if (e != Ending.Banjo)
            {
                MediaPlayer.Play(game.Content.Load <Song>("SpaceRock_V1"));
            }
        }
Esempio n. 13
0
        public Button(ADHDGame g, SpriteBatch sb, Texture2D t, Vector2 pos, EndScreen.Ending end, float time)
            : base(g, sb, t, pos, Rectangle.Empty, 0, 0.0f, false, 0)
        {
            ending = end;
            endTime = time;

            b1 = g.Content.Load<SoundEffect>("Bloop_01");
            b2 = g.Content.Load<SoundEffect>("bloop_02");
        }
Esempio n. 14
0
        public Button(ADHDGame g, SpriteBatch sb, Texture2D t, Vector2 pos, EndScreen.Ending end, float time)
            : base(g, sb, t, pos, Rectangle.Empty, 0, 0.0f, false, 0)
        {
            ending  = end;
            endTime = time;

            b1 = g.Content.Load <SoundEffect>("Bloop_01");
            b2 = g.Content.Load <SoundEffect>("bloop_02");
        }
Esempio n. 15
0
        public ADHDObject(ADHDGame g, SpriteBatch sb, Texture2D t, Vector2 pos, Rectangle init, int nFrames, float rate, bool l, int TYPE)
        {
            game       = g;
            upLeft     = Stage.PosToTile(pos);
            lowerRight = new Point(
                upLeft.X + init.Width / Stage.TileSize - 1,
                upLeft.Y + init.Height / Stage.TileSize - 1);
            position = pos;

            tex   = t;
            batch = sb;
            size  = new Vector2(init.Width, init.Height);

            anim = new Animation(init, nFrames, rate, l);
            if (l)
            {
                anim.Play();
            }
            type = TYPE;
        }
Esempio n. 16
0
        public GuiHUD(ADHDGame game, SpriteBatch sb)
        {
            g          = game;
            actionBtns = new List <GuiButton>(15);
            upBtns     = new List <Texture2D>(15);
            downBtns   = new List <Texture2D>(15);
            hoverBtns  = new List <Texture2D>(15);
            int i;

            sidebar   = g.Content.Load <Texture2D>("GuiButton\\SideMenu");
            energyBtn = g.Content.Load <Texture2D>("GuiButton\\EmptyButton");
            energy    = g.Content.Load <Texture2D>("GuiButton\\EnergyBlip");
            for (i = 0; i < 9; i++)
            {
                upBtns.Add(g.Content.Load <Texture2D>("GuiButton\\UpBtn\\UpBtn" + i.ToString()));
                downBtns.Add(g.Content.Load <Texture2D>("GuiButton\\DownBtn\\DownBtn" + i.ToString()));
                hoverBtns.Add(g.Content.Load <Texture2D>("GuiButton\\HoverBtn\\HoverBtn" + i.ToString()));

                //actionBtns.Add(new GuiButton(upBtns[i], downBtns[i], hoverBtns[i], new Vector2(0, 48 * i + 24)));
            }
            actionBtns.Add(new GuiButton(upBtns[0], downBtns[0], hoverBtns[0], Keys.W, new Vector2(10, 21)));
            actionBtns.Add(new GuiButton(upBtns[1], downBtns[1], hoverBtns[1], Keys.S, new Vector2(10, 21 + 48)));
            actionBtns.Add(new GuiButton(upBtns[2], downBtns[2], hoverBtns[2], Keys.A, new Vector2(10, 48 * 2 + 21)));
            actionBtns.Add(new GuiButton(upBtns[3], downBtns[3], hoverBtns[3], Keys.D, new Vector2(10, 48 * 3 + 21))); //end move
            actionBtns.Add(new GuiButton(upBtns[4], downBtns[4], hoverBtns[4], Keys.E, new Vector2(10, 48 * 4 + 21))); //
            actionBtns.Add(new GuiButton(upBtns[5], downBtns[5], hoverBtns[5], Keys.Q, new Vector2(10, 48 * 5 + 21))); //
            actionBtns.Add(new GuiButton(upBtns[6], downBtns[6], hoverBtns[6], Keys.R, new Vector2(10, 48 * 6 + 21))); //
            actionBtns.Add(new GuiButton(upBtns[7], downBtns[7], hoverBtns[7], Keys.F, new Vector2(10, 48 * 7 + 21))); //
            actionBtns.Add(new GuiButton(upBtns[8], downBtns[8], hoverBtns[8], Keys.V, new Vector2(10, 48 * 8 + 21)));
            // actionBtns.Add(new GuiButton(upBtns[9], downBtns[9], hoverBtns[9], Keys.Z, new Vector2(10, 48 * 9 + 21)));
            // actionBtns.Add(new GuiButton(upBtns[10], downBtns[10], hoverBtns[10], Keys.X, new Vector2(10, 48 * 10 + 21)));//
            // actionBtns.Add(new GuiButton(upBtns[11], downBtns[11], hoverBtns[11], Keys.C, new Vector2(10, 48 * 11 + 21)));//
            // actionBtns.Add(new GuiButton(upBtns[12], downBtns[12], hoverBtns[12], Keys.T, new Vector2(10, 48 * 12 + 21)));//
            //actionBtns.Add(new GuiButton(upBtns[13], downBtns[13], hoverBtns[13], Keys.G, new Vector2(10, 48 * 13 + 21)));//
            // actionBtns.Add(new GuiButton(upBtns[14], downBtns[14], hoverBtns[14], Keys.B, new Vector2(10, 48 * 14 + 21)));//
        }
Esempio n. 17
0
 public Conveyer(ADHDGame g, SpriteBatch sb, Texture2D t, Vector2 position, Rectangle init, int nFrames, float rate, bool l, int type, Robot.Direction dir)
     : base(g, sb, t, position, init, nFrames, rate, l, type)
 {
     cdir = dir;
     rec  = new Rectangle((int)position.X, (int)position.Y, Stage.TileSize, Stage.TileSize);
 }
Esempio n. 18
0
        public Stage(ADHDGame g, string file)
        {
            game = g;
            mainTex = g.Content.Load<Texture2D>(texName);
            objTex = g.Content.Load<Texture2D>(objTexName);
            batch = new SpriteBatch(g.GraphicsDevice);

            //get xml data in a document
            XmlDocument xml = new XmlDocument();
            string xmlString = "";
            using (StreamReader fr = new StreamReader(TitleContainer.OpenStream("Content\\" + file)))
            {
                xmlString = fr.ReadToEnd();
            }
            xml.LoadXml(xmlString);

            //read the width and height
            Width = Convert.ToInt32(xml.SelectSingleNode("map/layer/@width").Value);
            Height = Convert.ToInt32(xml.SelectSingleNode("map/layer/@height").Value);

            InitObjects();

            MainLayer = new int[Width, Height];
            TopLayer = new int[Width, Height];

            //get main layer
            int x = 0, y = 0;
            XmlNodeList list = xml.SelectNodes("map/layer[@name='" + mainLayerName + "']/data/tile/@gid");
            foreach (XmlNode node in list)
            {
                //minus 1 because Tiled uses 0 as blank, we won't!
                MainLayer[x, y] = Convert.ToInt32(node.Value) - 1;

                //hack special objects
                if (MainLayer[x, y] == TileToID(0, 12))
                {
                    AddConveyor(new Point(x, y), Robot.Direction.Right);
                }
                else if (MainLayer[x, y] == TileToID(0, 13))
                {
                    AddConveyor(new Point(x, y), Robot.Direction.Left);
                }
                else if (MainLayer[x, y] == TileToID(0, 14))
                {
                    AddConveyor(new Point(x, y), Robot.Direction.Up);
                }
                else if (MainLayer[x, y] == TileToID(0, 15))
                {
                    AddConveyor(new Point(x, y), Robot.Direction.Down);
                }

                ++x;

                //test for next row
                if (x >= Width)
                {
                    ++y;
                    x = 0;
                }
            }

            //get main layer
            x = 0;
            y = 0;
            list = xml.SelectNodes("map/layer[@name='" + topLayerName + "']/data/tile/@gid");
            foreach (XmlNode node in list)
            {
                //minus 1 because Tiled uses 0 as blank, we won't!
                TopLayer[x, y] = Convert.ToInt32(node.Value) - 1;

                ++x;

                //test for next row
                if (x >= Width)
                {
                    ++y;
                    x = 0;
                }
            }

            InitPassables();
        }
Esempio n. 19
0
 protected Screen(ADHDGame g, SpriteBatch sb)
 {
     game = g;
 }
Esempio n. 20
0
 public void setADHDGame(ADHDGame game)
 {
     g = game;
 }
Esempio n. 21
0
 public void setADHDGame(ADHDGame game)
 {
     g = game;
 }
Esempio n. 22
0
        public Stage(ADHDGame g, string file)
        {
            game    = g;
            mainTex = g.Content.Load <Texture2D>(texName);
            objTex  = g.Content.Load <Texture2D>(objTexName);
            batch   = new SpriteBatch(g.GraphicsDevice);

            //get xml data in a document
            XmlDocument xml       = new XmlDocument();
            string      xmlString = "";

            using (StreamReader fr = new StreamReader(TitleContainer.OpenStream("Content\\" + file)))
            {
                xmlString = fr.ReadToEnd();
            }
            xml.LoadXml(xmlString);

            //read the width and height
            Width  = Convert.ToInt32(xml.SelectSingleNode("map/layer/@width").Value);
            Height = Convert.ToInt32(xml.SelectSingleNode("map/layer/@height").Value);

            InitObjects();

            MainLayer = new int[Width, Height];
            TopLayer  = new int[Width, Height];

            //get main layer
            int         x = 0, y = 0;
            XmlNodeList list = xml.SelectNodes("map/layer[@name='" + mainLayerName + "']/data/tile/@gid");

            foreach (XmlNode node in list)
            {
                //minus 1 because Tiled uses 0 as blank, we won't!
                MainLayer[x, y] = Convert.ToInt32(node.Value) - 1;

                //hack special objects
                if (MainLayer[x, y] == TileToID(0, 12))
                {
                    AddConveyor(new Point(x, y), Robot.Direction.Right);
                }
                else if (MainLayer[x, y] == TileToID(0, 13))
                {
                    AddConveyor(new Point(x, y), Robot.Direction.Left);
                }
                else if (MainLayer[x, y] == TileToID(0, 14))
                {
                    AddConveyor(new Point(x, y), Robot.Direction.Up);
                }
                else if (MainLayer[x, y] == TileToID(0, 15))
                {
                    AddConveyor(new Point(x, y), Robot.Direction.Down);
                }

                ++x;

                //test for next row
                if (x >= Width)
                {
                    ++y;
                    x = 0;
                }
            }

            //get main layer
            x    = 0;
            y    = 0;
            list = xml.SelectNodes("map/layer[@name='" + topLayerName + "']/data/tile/@gid");
            foreach (XmlNode node in list)
            {
                //minus 1 because Tiled uses 0 as blank, we won't!
                TopLayer[x, y] = Convert.ToInt32(node.Value) - 1;

                ++x;

                //test for next row
                if (x >= Width)
                {
                    ++y;
                    x = 0;
                }
            }

            InitPassables();
        }
Esempio n. 23
0
 public Airlock(ADHDGame g, SpriteBatch sb, Texture2D t, Vector2 position)
     : base(g, sb, t, position, new Rectangle(0, 0, 320, 192), 3, 1.0f / 8.0f, false, 100)
 {
 }
Esempio n. 24
0
 public Airlock(ADHDGame g, SpriteBatch sb, Texture2D t, Vector2 position)
     : base(g, sb, t, position, new Rectangle(0, 0, 320, 192), 3, 1.0f / 8.0f, false, 100)
 {
 }
Esempio n. 25
0
 public Conveyer(ADHDGame g, SpriteBatch sb, Texture2D t, Vector2 position, Rectangle init, int nFrames, float rate, bool l, int type, Robot.Direction dir)
     : base(g, sb, t, position, init, nFrames, rate, l, type)
 {
     cdir = dir;
     rec = new Rectangle((int)position.X, (int)position.Y, Stage.TileSize, Stage.TileSize);
 }