Example #1
0
        public override void LoadRes(ContentManager cm)
        {
            TimeSpan delay = new TimeSpan(1050000);

            Dictionary <String, Direction> dirs = new Dictionary <string, Direction>();

            dirs["N"]  = Direction.NORTH;
            dirs["NE"] = Direction.NORTHEAST;
            dirs["E"]  = Direction.EAST;
            dirs["SE"] = Direction.SOUTHEAST;
            dirs["S"]  = Direction.SOUTH;
            dirs["SW"] = Direction.SOUTHWEST;
            dirs["W"]  = Direction.WEST;
            dirs["NW"] = Direction.NORTHWEST;

            foreach (string s in dirs.Keys)
            {
                AnimateSprite walker = new AnimateSprite(delay);

                Texture2D stand = cm.Load <Texture2D>("protag/Overworld/arms/stand/Stand - " + s);
                Texture2D walkL = cm.Load <Texture2D>("protag/Overworld/arms/walk/" + s + " L"), walkR = cm.Load <Texture2D>("protag/Overworld/arms/walk/" + s + " R");

                walker.Add(new StaticSprite(stand, new Point(35, 102)));
                walker.Add(new StaticSprite(walkL, new Point(35, 103)));
                walker.Add(new StaticSprite(walkL, new Point(35, 101)));
                walker.Add(new StaticSprite(stand, new Point(35, 102)));
                walker.Add(new StaticSprite(walkR, new Point(35, 103)));
                walker.Add(new StaticSprite(walkR, new Point(35, 101)));

                this.walk[dirs[s]]  = walker;
                this.stand[dirs[s]] = new StaticSprite(stand, new Point(35, 102));
            }
        }
Example #2
0
        public FirstScreen(ContentManager Content)
        {
            levelMap    = new LevelMap(700, 0, 700, 0);
            coordinates = new List <int>();
            isDone      = false;
            data        = "";

            //upper wall
            //would like to streamline the adding process at some point
            coordinates.Add(1);
            coordinates.Add(1);
            coordinates.Add(2);
            coordinates.Add(1);
            coordinates.Add(3);
            coordinates.Add(1);
            coordinates.Add(4);
            coordinates.Add(1);
            coordinates.Add(5);
            coordinates.Add(1);
            coordinates.Add(6);
            coordinates.Add(1);
            coordinates.Add(7);
            coordinates.Add(1);
            coordinates.Add(8);
            coordinates.Add(1);
            coordinates.Add(9);
            coordinates.Add(1);

            //dog
            levelMap.addObjectsWithName(5, 5, "Dave");
            //exit doorway at top right
            levelMap.addObjectsWithName(10, 0, "Exit");//this sorta works, but not very well -- need something better

            //load content
            firstScreen  = Content.Load <Texture2D>("tutorialscreen/tutotialroom");
            dialogScreen = Content.Load <Texture2D>("tutorialscreen/dialogscreen");

            //load font
            retroFont = Content.Load <SpriteFont>("fonts/RetroFont");

            daveTheDog    = Content.Load <Texture2D>("tutorialscreen/dogsprite");
            daveAnimation = new AnimateSprite(daveTheDog, 2, 4, false);

            //dialog for dog
            //using absolute path for now -- will be changed in the future, but this is good enough for now
            dialogReader.getDialog(@"C:\Users\ember\source\repos\firstrate\Content\TestDialog.txt");

            levelMap.addObjects(coordinates);
        }
Example #3
0
    private void OnEnable()
    {
        animateSprite = target as AnimateSprite;

        spritesPerSecond = animateSprite.spritesPerSecond;
        spriteDuration   = animateSprite.spriteDuration;

        list = new ReorderableList(serializedObject,
                                   serializedObject.FindProperty("sprites"),
                                   true, true, true, true);

        list.drawElementCallback = (Rect rect, int index, bool isActive, bool isFocused) => {
            var element = list.serializedProperty.GetArrayElementAtIndex(index);
            rect.y += 2;
            EditorGUI.PropertyField(new Rect(rect.x, rect.y, rect.width, EditorGUIUtility.singleLineHeight), element, GUIContent.none);
        };

        list.drawHeaderCallback = (Rect rect) => {
            EditorGUI.LabelField(rect, "Sprites");
        };
    }
Example #4
0
            public static void LoadRes(Microsoft.Xna.Framework.Content.ContentManager cm)
            {
                // Protagonist: Idle
                AnimateSprite atemp = new AnimateSprite(new TimeSpan(1050000));

                for (int i = 1; i < 5; i++)
                {
                    StaticSprite stemp = new StaticSprite(cm.Load <Texture2D>("Talking/Protag - Arms/Talk Portrait - Protag - Arms - Idle " + i));
                    atemp.Add(stemp);
                }
                for (int i = 0; i < 20; i++)
                {
                    StaticSprite stemp = new StaticSprite(cm.Load <Texture2D>("Talking/Protag - Arms/Talk Portrait - Protag - Arms - Idle 4"));
                    atemp.Add(stemp);
                }
                ports["pIdle"] = atemp;

                // Protagonist: Happy
                atemp = new AnimateSprite(new TimeSpan(1050000));
                for (int i = 1; i < 9; i++)
                {
                    StaticSprite stemp = new StaticSprite(cm.Load <Texture2D>("Talking/Protag - Arms/Talk Portrait - Protag - Arms - Talk Happy " + i));
                    atemp.Add(stemp);
                }
                ports["pHappy"] = atemp;

                // Flat Lizard: Idle
                atemp = new AnimateSprite(new TimeSpan(1050000));
                for (int i = 1; i < 6; i++)
                {
                    StaticSprite stemp = new StaticSprite(cm.Load <Texture2D>("Talking/NPCs/Tiny Animals/Talk Portrait - NPC - Flat Lizard - Idle " + i));
                    atemp.Add(stemp);
                }
                for (int i = 0; i < 20; i++)
                {
                    StaticSprite stemp = new StaticSprite(cm.Load <Texture2D>("Talking/NPCs/Tiny Animals/Talk Portrait - NPC - Flat Lizard - Idle 5"));
                    atemp.Add(stemp);
                }
                ports["flatlizIdle"] = atemp;

                // Flat Lizard: Talk
                atemp = new AnimateSprite(new TimeSpan(1050000));
                atemp.Add(new StaticSprite(cm.Load <Texture2D>("Talking/NPCs/Tiny Animals/Talk Portrait - NPC - Flat Lizard - Idle 1")));
                for (int i = 1; i < 4; i++)
                {
                    StaticSprite stemp = new StaticSprite(cm.Load <Texture2D>("Talking/NPCs/Tiny Animals/Talk Portrait - NPC - Flat Lizard - Talk " + i));
                    atemp.Add(stemp);
                }
                atemp.Add(new StaticSprite(cm.Load <Texture2D>("Talking/NPCs/Tiny Animals/Talk Portrait - NPC - Flat Lizard - Talk 2")));
                ports["flatlizTalk"] = atemp;

                // Lumisnail 1 & 2
                for (int n = 1; n < 3; n++)
                {
                    atemp = new AnimateSprite(new TimeSpan(1050000));
                    for (int i = 1; i < 5; i++)
                    {
                        StaticSprite stemp = new StaticSprite(cm.Load <Texture2D>("Talking/NPCs/Tiny Animals/Talk Portrait - NPC - Lumisnail " + n + " - All " + i));
                        atemp.Add(stemp);
                    }
                    ports["lumisnail" + n] = atemp;
                }

                // Mantis
                atemp = new AnimateSprite(new TimeSpan(1050000));
                for (int i = 1; i < 5; i++)
                {
                    StaticSprite stemp = new StaticSprite(cm.Load <Texture2D>("Talking/NPCs/Tiny Animals/Talk Portrait - NPC - Mantis - All " + i));
                    atemp.Add(stemp);
                }
                ports["mantis"] = atemp;

                top       = new StaticSprite(cm.Load <Texture2D>("Talking/Talk Box U"));
                bottom    = new StaticSprite(cm.Load <Texture2D>("Talking/Talk Box D"));
                nameplate = new StaticSprite(cm.Load <Texture2D>("Talking/Talk Nameplate"));
            }
        public static void Load()
        {
            Texture2D grass = Globals.Content.Load<Texture2D>("grass");
            Texture2D pad = Globals.Content.Load<Texture2D>("pad");
            Texture2D Water = Globals.Content.Load<Texture2D>("GFX\\Tiles\\Waterp");

            Texture2D PadV = Globals.Content.Load<Texture2D>("GFX\\Tiles\\testp");
            Texture2D PadH = Globals.Content.Load<Texture2D>("GFX\\Tiles\\testp2");

            Texture2D lily1 = Globals.Content.Load<Texture2D>("GFX\\Tiles\\testb");
            Texture2D lily2 = Globals.Content.Load<Texture2D>("GFX\\Tiles\\testb2");

            Texture2D StatsWindow = Globals.Content.Load<Texture2D>("GUI\\Currency\\StatsWindow");
            Texture2D Enter2Play = Globals.Content.Load<Texture2D>("Enter");
            Texture2D Trapmenu = Globals.Content.Load<Texture2D>("GUI\\TrapMenu\\BuyTab");

            Texture2D arrowNormal = Globals.Content.Load<Texture2D>("GUI\\Toren");
            Texture2D arrowHover = Globals.Content.Load<Texture2D>("GUI\\arrow_hover");
            Texture2D arrow_pressed = Globals.Content.Load<Texture2D>("GUI\\arrow_pressed");

            Texture2D gasTrap = Globals.Content.Load<Texture2D>("GFX\\Traps\\Trap_Poinsion_gas");
            Texture2D fenceTrap = Globals.Content.Load<Texture2D>("GFX\\Traps\\fence");

            Texture2D PsnNormal = Globals.Content.Load<Texture2D>("Traps\\spike tower");
            Texture2D PsnHover = Globals.Content.Load<Texture2D>("Traps\\spike hover");
            Texture2D PsnPressed = Globals.Content.Load<Texture2D>("Traps\\spike tower");
            blatex = Globals.Content.Load<Texture2D>("grastiles");

            SpriteFont font = Globals.Content.Load<SpriteFont>("Fonts\\Arial");

            level.AddTexture(pad);
            level.AddTexture(Water);

            level.AddTexture(lily1);
            level.AddTexture(lily2);

            level.AddTexture(PadH);
            level.AddTexture(PadV);

            Texture2D[] towertextures = new Texture2D[]
            {
                Globals.Content.Load<Texture2D>("GFX\\Traps\\GasTrap\\gas1"),
                Globals.Content.Load<Texture2D>("GFX\\Traps\\Trap_Poinsion_gas")
            };

            Texture2D[] bullettextures = new Texture2D[]
            {
                Globals.Content.Load<Texture2D>("GFX\\Traps\\GasTrap\\G13")
            };

            TileTextures = new Texture2D[]
            {
                /*Globals.Content.Load<Texture2D>("GFX\\Tiles\\testb"),
                Globals.Content.Load<Texture2D>("GFX\\Tiles\\testb2"),
                Globals.Content.Load<Texture2D>("GFX\\Tiles\\testp"),
                Globals.Content.Load<Texture2D>("GFX\\Tiles\\testp2")*/

                Globals.Content.Load<Texture2D>("watertiles"),
                Globals.Content.Load<Texture2D>("grastiles")
            };

            FrogTextures = new Texture2D[]
            {
                Globals.Content.Load<Texture2D>("GFX\\Mobs\\Frog\\frogfront0001"),
                Globals.Content.Load<Texture2D>("GFX\\Mobs\\Frog\\frogfront0002"),
                Globals.Content.Load<Texture2D>("GFX\\Mobs\\Frog\\frogfront0003"),
                Globals.Content.Load<Texture2D>("GFX\\Mobs\\Frog\\frogfront0004"),
                Globals.Content.Load<Texture2D>("GFX\\Mobs\\Frog\\frogfront0005"),
                Globals.Content.Load<Texture2D>("GFX\\Mobs\\Frog\\frogfront0006"),
                Globals.Content.Load<Texture2D>("GFX\\Mobs\\Frog\\frogfront0007"),
                Globals.Content.Load<Texture2D>("GFX\\Mobs\\Frog\\frogfront0008"),
                Globals.Content.Load<Texture2D>("GFX\\Mobs\\Frog\\frogfront0009"),
                Globals.Content.Load<Texture2D>("GFX\\Mobs\\Frog\\frogfront0010"),
            };

            BatTextures = new Texture2D[]
            {
                Globals.Content.Load<Texture2D>("GFX\\Mobs\\Bat\\Bat0001"),
                Globals.Content.Load<Texture2D>("GFX\\Mobs\\Bat\\Bat0002"),
                Globals.Content.Load<Texture2D>("GFX\\Mobs\\Bat\\Bat0003"),
                Globals.Content.Load<Texture2D>("GFX\\Mobs\\Bat\\Bat0004"),
                Globals.Content.Load<Texture2D>("GFX\\Mobs\\Bat\\Bat0005"),
                Globals.Content.Load<Texture2D>("GFX\\Mobs\\Bat\\Bat0006"),
                Globals.Content.Load<Texture2D>("GFX\\Mobs\\Bat\\Bat0007"),
                Globals.Content.Load<Texture2D>("GFX\\Mobs\\Bat\\Bat0008"),
                Globals.Content.Load<Texture2D>("GFX\\Mobs\\Bat\\Bat0009")
            };

            waveManager = new WaveManager(level, 10, FrogTextures[0]);
            waterWavemanager = new WaterWaveManager(level,10, BatTextures[0]);
            player = new Player(level, towertextures, bullettextures);
            toolbar = new Toolbar(StatsWindow, font, new Vector2(500,550));
            menuScreen = new MenuScreen(Enter2Play, new Vector2(400, 300));
            arrowButton = new Button(grass,grass,grass, new Vector2(925,20),player,"Arrow Tower");
            PsnGasButton = new Button(grass,grass,grass, new Vector2(925,1), player,"Poison Gas");
            gamemanager = new GameManager(level,waterWavemanager, waveManager, Trapmenu);
            blabla = new AnimateSprite(blatex, new Vector2(100, 100),8,1);
            racoonmanager = new RacoonManager(level, blatex,player);
        }
 void Start()
 {
     _animateSprite             = GetComponent <AnimateSprite> ();
     _animateSprite.scrollSpeed = currVelocity * RATIO;
     initVel = currVelocity;
 }
Example #7
0
 private void Awake()
 {
     animateSprite = gameObject.GetComponent<AnimateSprite>();
 }
        public static void Load()
        {
            Texture2D grass = Globals.Content.Load <Texture2D>("grass");
            Texture2D pad   = Globals.Content.Load <Texture2D>("pad");
            Texture2D Water = Globals.Content.Load <Texture2D>("GFX\\Tiles\\Waterp");

            Texture2D PadV = Globals.Content.Load <Texture2D>("GFX\\Tiles\\testp");
            Texture2D PadH = Globals.Content.Load <Texture2D>("GFX\\Tiles\\testp2");

            Texture2D lily1 = Globals.Content.Load <Texture2D>("GFX\\Tiles\\testb");
            Texture2D lily2 = Globals.Content.Load <Texture2D>("GFX\\Tiles\\testb2");

            Texture2D StatsWindow = Globals.Content.Load <Texture2D>("GUI\\Currency\\StatsWindow");
            Texture2D Enter2Play  = Globals.Content.Load <Texture2D>("Enter");
            Texture2D Trapmenu    = Globals.Content.Load <Texture2D>("GUI\\TrapMenu\\BuyTab");

            Texture2D arrowNormal   = Globals.Content.Load <Texture2D>("GUI\\Toren");
            Texture2D arrowHover    = Globals.Content.Load <Texture2D>("GUI\\arrow_hover");
            Texture2D arrow_pressed = Globals.Content.Load <Texture2D>("GUI\\arrow_pressed");

            Texture2D gasTrap   = Globals.Content.Load <Texture2D>("GFX\\Traps\\Trap_Poinsion_gas");
            Texture2D fenceTrap = Globals.Content.Load <Texture2D>("GFX\\Traps\\fence");

            Texture2D PsnNormal  = Globals.Content.Load <Texture2D>("Traps\\spike tower");
            Texture2D PsnHover   = Globals.Content.Load <Texture2D>("Traps\\spike hover");
            Texture2D PsnPressed = Globals.Content.Load <Texture2D>("Traps\\spike tower");

            blatex = Globals.Content.Load <Texture2D>("grastiles");

            SpriteFont font = Globals.Content.Load <SpriteFont>("Fonts\\Arial");

            level.AddTexture(pad);
            level.AddTexture(Water);

            level.AddTexture(lily1);
            level.AddTexture(lily2);

            level.AddTexture(PadH);
            level.AddTexture(PadV);

            Texture2D[] towertextures = new Texture2D[]
            {
                Globals.Content.Load <Texture2D>("GFX\\Traps\\GasTrap\\gas1"),
                Globals.Content.Load <Texture2D>("GFX\\Traps\\Trap_Poinsion_gas")
            };

            Texture2D[] bullettextures = new Texture2D[]
            {
                Globals.Content.Load <Texture2D>("GFX\\Traps\\GasTrap\\G13")
            };

            TileTextures = new Texture2D[]
            {
                /*Globals.Content.Load<Texture2D>("GFX\\Tiles\\testb"),
                *  Globals.Content.Load<Texture2D>("GFX\\Tiles\\testb2"),
                *  Globals.Content.Load<Texture2D>("GFX\\Tiles\\testp"),
                *  Globals.Content.Load<Texture2D>("GFX\\Tiles\\testp2")*/

                Globals.Content.Load <Texture2D>("watertiles"),
                Globals.Content.Load <Texture2D>("grastiles")
            };

            FrogTextures = new Texture2D[]
            {
                Globals.Content.Load <Texture2D>("GFX\\Mobs\\Frog\\frogfront0001"),
                Globals.Content.Load <Texture2D>("GFX\\Mobs\\Frog\\frogfront0002"),
                Globals.Content.Load <Texture2D>("GFX\\Mobs\\Frog\\frogfront0003"),
                Globals.Content.Load <Texture2D>("GFX\\Mobs\\Frog\\frogfront0004"),
                Globals.Content.Load <Texture2D>("GFX\\Mobs\\Frog\\frogfront0005"),
                Globals.Content.Load <Texture2D>("GFX\\Mobs\\Frog\\frogfront0006"),
                Globals.Content.Load <Texture2D>("GFX\\Mobs\\Frog\\frogfront0007"),
                Globals.Content.Load <Texture2D>("GFX\\Mobs\\Frog\\frogfront0008"),
                Globals.Content.Load <Texture2D>("GFX\\Mobs\\Frog\\frogfront0009"),
                Globals.Content.Load <Texture2D>("GFX\\Mobs\\Frog\\frogfront0010"),
            };

            BatTextures = new Texture2D[]
            {
                Globals.Content.Load <Texture2D>("GFX\\Mobs\\Bat\\Bat0001"),
                Globals.Content.Load <Texture2D>("GFX\\Mobs\\Bat\\Bat0002"),
                Globals.Content.Load <Texture2D>("GFX\\Mobs\\Bat\\Bat0003"),
                Globals.Content.Load <Texture2D>("GFX\\Mobs\\Bat\\Bat0004"),
                Globals.Content.Load <Texture2D>("GFX\\Mobs\\Bat\\Bat0005"),
                Globals.Content.Load <Texture2D>("GFX\\Mobs\\Bat\\Bat0006"),
                Globals.Content.Load <Texture2D>("GFX\\Mobs\\Bat\\Bat0007"),
                Globals.Content.Load <Texture2D>("GFX\\Mobs\\Bat\\Bat0008"),
                Globals.Content.Load <Texture2D>("GFX\\Mobs\\Bat\\Bat0009")
            };

            waveManager      = new WaveManager(level, 10, FrogTextures[0]);
            waterWavemanager = new WaterWaveManager(level, 10, BatTextures[0]);
            player           = new Player(level, towertextures, bullettextures);
            toolbar          = new Toolbar(StatsWindow, font, new Vector2(500, 550));
            menuScreen       = new MenuScreen(Enter2Play, new Vector2(400, 300));
            arrowButton      = new Button(grass, grass, grass, new Vector2(925, 20), player, "Arrow Tower");
            PsnGasButton     = new Button(grass, grass, grass, new Vector2(925, 1), player, "Poison Gas");
            gamemanager      = new GameManager(level, waterWavemanager, waveManager, Trapmenu);
            blabla           = new AnimateSprite(blatex, new Vector2(100, 100), 8, 1);
            racoonmanager    = new RacoonManager(level, blatex, player);
        }
Example #9
0
            public static void LoadRes(Microsoft.Xna.Framework.Content.ContentManager cm)
            {
                // Protagonist: Idle
                AnimateSprite atemp = new AnimateSprite(new TimeSpan(1050000));
                for(int i = 1; i < 5; i++) {
                    StaticSprite stemp = new StaticSprite(cm.Load<Texture2D>("Talking/Protag - Arms/Talk Portrait - Protag - Arms - Idle " + i));
                    atemp.Add(stemp);
                }
                for(int i = 0; i < 20; i++) {
                    StaticSprite stemp = new StaticSprite(cm.Load<Texture2D>("Talking/Protag - Arms/Talk Portrait - Protag - Arms - Idle 4"));
                    atemp.Add(stemp);
                }
                ports["pIdle"] = atemp;

                // Protagonist: Happy
                atemp = new AnimateSprite(new TimeSpan(1050000));
                for(int i = 1; i < 9; i++) {
                    StaticSprite stemp = new StaticSprite(cm.Load<Texture2D>("Talking/Protag - Arms/Talk Portrait - Protag - Arms - Talk Happy " + i));
                    atemp.Add(stemp);
                }
                ports["pHappy"] = atemp;

                // Flat Lizard: Idle
                atemp = new AnimateSprite(new TimeSpan(1050000));
                for(int i = 1; i < 6; i++) {
                    StaticSprite stemp = new StaticSprite(cm.Load<Texture2D>("Talking/NPCs/Tiny Animals/Talk Portrait - NPC - Flat Lizard - Idle " + i));
                    atemp.Add(stemp);
                }
                for(int i = 0; i < 20; i++) {
                    StaticSprite stemp = new StaticSprite(cm.Load<Texture2D>("Talking/NPCs/Tiny Animals/Talk Portrait - NPC - Flat Lizard - Idle 5"));
                    atemp.Add(stemp);
                }
                ports["flatlizIdle"] = atemp;

                // Flat Lizard: Talk
                atemp = new AnimateSprite(new TimeSpan(1050000));
                atemp.Add(new StaticSprite(cm.Load<Texture2D>("Talking/NPCs/Tiny Animals/Talk Portrait - NPC - Flat Lizard - Idle 1")));
                for(int i = 1; i < 4; i++) {
                    StaticSprite stemp = new StaticSprite(cm.Load<Texture2D>("Talking/NPCs/Tiny Animals/Talk Portrait - NPC - Flat Lizard - Talk " + i));
                    atemp.Add(stemp);
                }
                atemp.Add(new StaticSprite(cm.Load<Texture2D>("Talking/NPCs/Tiny Animals/Talk Portrait - NPC - Flat Lizard - Talk 2")));
                ports["flatlizTalk"] = atemp;

                // Lumisnail 1 & 2
                for(int n = 1; n < 3; n++) {
                    atemp = new AnimateSprite(new TimeSpan(1050000));
                    for(int i = 1; i < 5; i++) {
                        StaticSprite stemp = new StaticSprite(cm.Load<Texture2D>("Talking/NPCs/Tiny Animals/Talk Portrait - NPC - Lumisnail " + n + " - All " + i));
                        atemp.Add(stemp);
                    }
                    ports["lumisnail" + n] = atemp;
                }

                // Mantis
                atemp = new AnimateSprite(new TimeSpan(1050000));
                for(int i = 1; i < 5; i++) {
                    StaticSprite stemp = new StaticSprite(cm.Load<Texture2D>("Talking/NPCs/Tiny Animals/Talk Portrait - NPC - Mantis - All " + i));
                    atemp.Add(stemp);
                }
                ports["mantis"] = atemp;

                top = new StaticSprite(cm.Load<Texture2D>("Talking/Talk Box U"));
                bottom = new StaticSprite(cm.Load<Texture2D>("Talking/Talk Box D"));
                nameplate = new StaticSprite(cm.Load<Texture2D>("Talking/Talk Nameplate"));
            }