Ejemplo n.º 1
0
 public AnimationHandler(int height, int width, List<int> frameCounts, List<int> frameDurations, List<bool> willLoop)
 {
     ignoreAnimationChange = false;
     spriteHeight = height;
     spriteWidth = width;
     frames = frameCounts;
     durations = frameDurations;
     textureSection = new Rectangle (0, 0, width, height);
     t = 0;
     loops = willLoop;
     network = null;
 }
Ejemplo n.º 2
0
        public GameStateMainMenu(ContentManager c, Game1 g)
        {
            Content = c;

            inputHandler = new InputHandler ();
            buttons = new List<Sprite> ();

            network = null;

            game = g;

            m = new Menu(new Vector2(5, 5), new String[] { "NEW GAME", "CONTROLS", "CREDITS", "QUIT" }, new Menu.menuAction[] { startGame, showControls, showCredits, quitGame }, 4, 1, "profont.png", Content);

            bg = new Sprite("excav-bg.png", Content, new Vector2(0, 0), false);
            topMask = new Sprite("excav-topmask.png", Content, new Vector2(0, 0), false);
            loadingOverlay = new Sprite("loading-overlay.png", Content, new Vector2(0, 0), false);

            string[] scrollLines = new string[] {
                "In the year 22XX",
                "A new world supply of energy is discovered.",
                "",
                "Marsium.",
                "",
                "As its name suggests, it can only be found",
                "on Mars.",
                "",
                "Within 50 years of its discovery, only one",
                "corporation controls the world supply.",
                "\\3MarsTek.",
                "",
                "You are a rookie drill technician, sent to",
                "a newly-discovered Marsium deposit far from",
                "Civilization.",
                "",
                "",
                ""};
            scrollSystems = new TextSystem[scrollLines.Length];
            for (int x = 0; x < scrollLines.Length; x++) {
                scrollSystems[x] = new TextSystem("profont.png", Content);
                scrollSystems[x].resetString(new Vector2(0, 0));
                scrollSystems[x].addString(scrollLines[x]);
                scrollSystems[x].setPosition(new Vector2(375 - scrollSystems[x].getWidth()/2, 780 + (scrollSystems[x].getHeight() + 2)*x));
                scrollSystems[x].update(1);
            }
        }
Ejemplo n.º 3
0
 public void doNetworkedAnimationUpdates(NetworkInterface ni)
 {
     network = ni;
 }
Ejemplo n.º 4
0
 private void startGame()
 {
     network = new NetworkInterface("ws://game2.andrewbarry.me/ws", Content);
     network.setOnReady(doGameTransition);
 }
Ejemplo n.º 5
0
 public void setNetworkInterface(NetworkInterface ni)
 {
     network = ni;
     player.animHandler.doNetworkedAnimationUpdates(ni);
 }