Exemplo n.º 1
0
        public OptionsScreen(GameScreen s)
        {
            gameScreen = s;
            buttons = new List<MenuButton>();

            //Music Option Buttons
            int SoundX = 125;
            int SoundY = 200;
            soundBarPos = new Vector2(SoundX, SoundY - 50);
            buttons.Add(new MenuButton(new Rectangle(SoundX, 100, 150, 40), "Music ", OnOffSoundVolume));
            buttons.Add(new MenuButton(new Rectangle(SoundX, 200, 150, 40), "Volume + ", IncreaseSoundVolume));
            buttons.Add(new MenuButton(new Rectangle(SoundX, 250, 150, 40), "Volume - ", DecreaseSoundVolume));
            buttons.Add(new MenuButton(new Rectangle(SoundX, 300, 150, 40), "Next Track ", PlayNextTrack));

            //Sound Option Buttons
            int EffectX = 350;
            int EffectY = 200;
            effectBarPos = new Vector2(EffectX, EffectY - 50);
            buttons.Add(new MenuButton(new Rectangle(EffectX, 100, 150, 40), "Effects", OnOffEffectVolume));
            buttons.Add(new MenuButton(new Rectangle(EffectX, 200, 150, 40), "Volume + ", IncreaseEffectVolume));
            buttons.Add(new MenuButton(new Rectangle(EffectX, 250, 150, 40), "Volume - ", DecreaseEffectVolume));

            //Back button
            buttons.Add(new MenuButton(new Rectangle(125, 550, 150, 40), "Back ", MenuManager.ClickPrevScreen));
            if (gameScreen != null)
            {
                buttons.Add(new MenuButton(new Rectangle(125, 450, 150, 40), "Save Game", SaveGameScreen));
            }

            volBarTexture = new Texture2D(Game1.device, 1, 1, true, SurfaceFormat.Color);
            volBarTexture.SetData(new[] { volBarColor });
        }
Exemplo n.º 2
0
 public CommandMenu(Rectangle r, GameScreen gs)
     : base(r)
 {
     //wierd syntax
     this.currentcolor = new Color(0, 0, 0, 150);
     padding = 5;
     gamescreen = gs;
     //clickedaction = gs.clickedaction;
     //middleman = gs.middleman;
 }
Exemplo n.º 3
0
        public TopMenu(Rectangle r, GameScreen gs)
            : base(r)
        {
            //wierd syntax
            padding = 5;
            gamescreen = gs;
            this.currentcolor = new Color(0, 0, 0, 150);

            this.Add(new TextLine(this.area,gamescreen.space.ToString()));
            this.Add(new MenuButton(new Rectangle(area.Left + 200, area.Top, 100, area.Height), "Options", MenuManager.ClickMusicOptions ));
            this.Add(new MenuButton(new Rectangle(area.Left + 350, area.Top, 100, area.Height), "Quit", Quitter));

            resource = new TextLine(new Rectangle(area.Right - 100, area.Top, 100, area.Height), "banana");
            this.Add(resource);
        }
Exemplo n.º 4
0
 public Client(String ipstring, SlaveDriver sd, GameScreen GS)
 {
     gs = GS;
     try { ip = IPAddress.Parse(ipstring); }
     catch (Exception e) { MenuManager.ClickGlobalLobby(this, EventArgs.Empty); return; }
     end = new IPEndPoint(ip, 6112);
     end2 = new IPEndPoint(ip, 6113);
     socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
     aSock = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
     //socket.Bind(new IPEndPoint(IPAddress.Loopback, 0));
     slavedriver = sd;
     //socket.EnableBroadcast = false;
     ReceiveMap();
     //Start attendance thread;
     TakeAttendance();
 }
Exemplo n.º 5
0
 public Host(Map m, SlaveDriver sd, int n, GameScreen GS)
 {
     AttendanceThread.socklist = new List<Socket>();
     HostThread.streamlist = new List<NetworkStream>();
     gs = GS;
     ip = IPAddress.Any; //IPAddress.Parse("70.55.141.164");
     end = new IPEndPoint(ip, 6112);
     end2 = new IPEndPoint(ip, 6113);
     listensocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
     aSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
     listensocket.Bind(end);
     aSocket.Bind(end2);
     //listensocket.EnableBroadcast = false;
     slavedriver = sd;
     slavedriver.SetMap(m);
     numclients = n;
     map = m;
     SendMap();
     TakeAttendance();
 }
Exemplo n.º 6
0
 // public static void ClickMapSelect() { screen = new MapSelectScreen(batch, font); }
 //screen for changing music
 public static void ClickMusicOptions(Object o, EventArgs e)
 {
     if (screen is GameScreen)
     {
         prevGameScreen = (GameScreen) screen;
     }
     prevScreen = screen;
     screen = new OptionsScreen(prevGameScreen);
 }
Exemplo n.º 7
0
 //some menu clicking event functions,
 public static void ClickTitle(Object o, EventArgs e)
 {
     screen = new TitleScreen(batch, font);
     prevGameScreen = null;
     prevScreen = null;
 }
Exemplo n.º 8
0
 //Player player;
 public SlaveDriver(GameScreen gs)
 {
     gamescreen = gs;
 }