示例#1
0
 public SoundControl(Ballz game)
 {
     Game         = game;
     loadedSounds = new Dictionary <string, SoundEffect>();
     WinnerSounds.Add("Germoney", "Sounds/germoney");
     WinnerSounds.Add("Murica", "Sounds/freedom_fuckyeah");
 }
示例#2
0
文件: Server.cs 项目: webconfig/Ballz
 public void Start()
 {
     Peer.Start();
     HandleNewPlayer(null, new LobbyPlayerGreeting {
         PlayerName = Ballz.The().Settings.PlayerName
     });
 }
示例#3
0
文件: Client.cs 项目: webconfig/Ballz
        private void HandleMatchStart(GameStartInfo startInfo)
        {
            var settings = MatchSettings.Deserialize(startInfo.Settings);

            Ballz.The().Network.StartNetworkGame(settings, startInfo.YourPlayerId);
            Ballz.The().Match.IsRemoteControlled = true;
        }
示例#4
0
        protected override void ImplInitializeSession(Ballz game, MatchSettings settings)
        {
            var mapTexture = MapName == "Generated" ? TerrainGenerator.GenerateTerrain(width, height): game.Content.Load <Texture2D>("Worlds/" + MapName);

            settings.MapName    = MapName;
            settings.MapTexture = mapTexture;
        }
示例#5
0
文件: Pistol.cs 项目: webconfig/Ballz
        public override void FireShot()
        {
            if (ShotsFired < MaxShots || !Game.Match.UsePlayerTurns)
            {
                ++ShotsFired;
                Game.Services.GetService <SoundControl>().PlaySound(SoundControl.PistolSound);

                var muzzle = SpriteGraphicsEffect.CreateMuzzle(
                    Game.Match.GameTime,
                    Ball.Position + 2f * Ball.AimDirection,
                    Ball.AimDirection.RotationFromDirection()
                    );
                Game.Match.World.GraphicsEvents.Add(muzzle);

                var rayHit = Game.Match.Physics.Raycast(Ball.Position, Ball.Position + Ball.AimDirection * 1000f);
                if (rayHit.HasHit)
                {
                    Game.Match.World.StaticGeometry.SubtractCircle(rayHit.Position.X, rayHit.Position.Y, ExplosionRadius);
                    Ballz.The().Match.World.GraphicsEvents.Add(SpriteGraphicsEffect.CreateExplosion(Ballz.The().Match.GameTime, rayHit.Position, 0, 0.2f));
                    if (rayHit.Entity != null)
                    {
                        if (rayHit.Entity is Ball)
                        {
                            Ball theBall = rayHit.Entity as Ball;
                            if (theBall.Health > 0)
                            {
                                theBall.ChangeHealth(-Damage);
                            }
                        }
                    }
                }
            }
        }
示例#6
0
 public SoundControl(Ballz game)
 {
     Game = game;
     loadedSounds = new Dictionary<string, SoundEffect>();
     WinnerSounds.Add("Germoney","Sounds/germoney");
     WinnerSounds.Add("Murica", "Sounds/freedom_fuckyeah");
 }
示例#7
0
        public Session(Ballz _game, World.World world, MatchSettings settings)
        {
            World        = world;
            Terrain      = World.StaticGeometry;
            GameSettings = settings;

            Physics         = new Physics.PhysicsControl(_game);
            Physics.Enabled = false;
            _game.Components.Add(Physics);

            GameRenderer         = new Renderer.GameRenderer(_game);
            GameRenderer.Enabled = false;
            GameRenderer.Visible = false;
            _game.Components.Add(GameRenderer);

            DebugRenderer         = new Renderer.DebugRenderer(_game);
            DebugRenderer.Enabled = false;
            DebugRenderer.Visible = false;
            _game.Components.Add(DebugRenderer);

            SessionLogic         = new Logic.GameLogic(_game, this);
            SessionLogic.Enabled = false;
            _game.Components.Add(SessionLogic);

            Logic          = _game.Services.GetService <LogicControl>();
            Logic.Message += Physics.HandleMessage;
            Logic.Message += GameRenderer.HandleMessage;
            Logic.Message += SessionLogic.HandleMessage;
            Logic.Message += DebugRenderer.HandleMessage;

            Input = _game.Services.GetService <Input.InputTranslator>();

            Game = _game;
        }
示例#8
0
        public void Start()
        {
            BrowserThread = new Thread(() =>
            {
                Browser                   = new WebBrowser();
                Browser.Width             = Ballz.The().GraphicsDevice.Viewport.Width;
                Browser.Height            = Ballz.The().GraphicsDevice.Viewport.Height;
                Browser.ScrollBarsEnabled = false;
                //Browser.IsWebBrowserContextMenuEnabled = false;
                LatestBitmap       = new Bitmap(Browser.Width, Browser.Height);
                Browser.Validated += (s, e) =>
                {
                    lock (this)
                    {
                        Browser.DrawToBitmap(LatestBitmap, new Rectangle(0, 0, Browser.Width, Browser.Height));
                    }
                };

                Browser.DocumentCompleted += (s, e) =>
                {
                    lock (this)
                    {
                        Browser.DrawToBitmap(LatestBitmap, new Rectangle(0, 0, Browser.Width, Browser.Height));
                    }
                };

                Browser.Navigate("file://C:/Users/Lukas/Documents/gui.html");

                var context = new ApplicationContext();
                Application.Run();
            });

            BrowserThread.SetApartmentState(ApartmentState.STA);
            BrowserThread.Start();
        }
示例#9
0
 public void SetMainMenu(MenuPanel menu)
 {
     activeMenu.Clear();
     activeMenu.Push(menu); //TODO: uncast
     state = GameState.MenuState;
     menu.OnOpen();
     Ballz.The().LockMouse = false;
 }
示例#10
0
 // StartSession must _not_ modify GameSettings
 public Session StartSession(Ballz game, MatchSettings settings, bool isMultiplayer, int localPlayerId)
 {
     if (!IsInitialized)
     {
         InitializeSession(game, settings);
     }
     return(ImplStartSession(game, settings, isMultiplayer, localPlayerId));
 }
示例#11
0
 private void ProcessMouseInput()
 {
     if (CurrentMouseState.LeftButton != PreviousMouseState.LeftButton)
     {
         var isPressed = CurrentMouseState.LeftButton == ButtonState.Pressed;
         var player    = Ballz.The().Match?.PlayerByNumber(1);
         OnInput(InputMessage.MessageType.ControlsAction, pressed: isPressed, player: player);
     }
 }
示例#12
0
        public override void OnEntityCollision(Entity other)
        {
            if (Ballz.The().Match.IsRemoteControlled)
            {
                return;
            }
            //TODO: Player damage

            onAnyCollision();
        }
示例#13
0
        public static Texture2D LoadTextureData(string pngdata)
        {
            var png = Convert.FromBase64String(pngdata);

            using (var ms = new MemoryStream(png))
            {
                var texture = Texture2D.FromStream(Ballz.The().GraphicsDevice, ms);
                return(texture);
            }
        }
示例#14
0
 public PerformanceReporter(Ballz game)
 {
     StackFrame frame = new StackFrame(1);
     var method = frame.GetMethod();
     var type = method.DeclaringType;
     Name = type.Name+"."+method.Name;
     Game=game;
     Sw = new Stopwatch();
     Sw.Start();
 }
示例#15
0
文件: Server.cs 项目: webconfig/Ballz
        private void HandleRemoteInput(NetConnection sender, InputMessage msg)
        {
            var player = PlayersByConnection[sender.RemoteUniqueIdentifier].MatchPlayer;

            msg.Player = player;
            if (player != null)
            {
                Ballz.The().Input.InjectInputMessage(msg, player);
            }
        }
示例#16
0
        public LogicControl(Ballz game)
        {
            Game = game;

            Composite menu = Game.MainMenu;// = DefaultMenu();
            //push the root menuToPrepare
            activeMenu.Push(menu); //TODO: uncast
            RegisterMenuEvents(menu);

            state = GameState.MenuState;
        }
示例#17
0
        public PerformanceReporter(Ballz game)
        {
            StackFrame frame  = new StackFrame(1);
            var        method = frame.GetMethod();
            var        type   = method.DeclaringType;

            Name = type.Name + "." + method.Name;
            Game = game;
            Sw   = new Stopwatch();
            Sw.Start();
        }
示例#18
0
 protected virtual void RaiseMessageEvent(Message msg)
 {
     Message?.Invoke(this, msg);
     if (state == GameState.MenuState)
     {
         Ballz.The().Services.GetService <SoundControl>().StartMusic(SoundControl.MenuMusic);
     }
     else
     {
         Ballz.The().Services.GetService <SoundControl>().StopMusic(SoundControl.MenuMusic);
     }
 }
示例#19
0
        public void OpenMenu(MenuPanel newMenu)
        {
            var oldMenu = activeMenu.Peek();

            oldMenu.OnClose();
            newMenu.OnOpen();

            activeMenu.Push(newMenu);
            RaiseMessageEvent(new MenuMessage(activeMenu.Peek()));
            state = GameState.MenuState;
            Ballz.The().LockMouse = false;
        }
示例#20
0
        public BallControl(Ballz game, Session match, Ball ball)
        {
            Game = game;
            Match = match;
            Ball = ball;

            KeyPressed[InputMessage.MessageType.ControlsAction] = false;
            KeyPressed[InputMessage.MessageType.ControlsUp] = false;
            KeyPressed[InputMessage.MessageType.ControlsDown] = false;
            KeyPressed[InputMessage.MessageType.ControlsLeft] = false;
            KeyPressed[InputMessage.MessageType.ControlsRight] = false;
        }
示例#21
0
 public Texture2D GetTerrainTypeTexture()
 {
     Update();
     lock (PublicShape)
     {
         if (PublicShape.TypeTexture == null)
         {
             PublicShape.TypeTexture = new Texture2D(Ballz.The().GraphicsDevice, width, height);
             PublicShape.TypeTexture.SetData(PublicShape.TypeData);
         }
     }
     return(PublicShape.TypeTexture);
 }
示例#22
0
        private void OnInput(InputMessage.MessageType inputType, bool pressed = false, char key = char.MinValue, Player player = null)
        {
            var inputMessage = new InputMessage(inputType, pressed, key, player);

            if (Ballz.The().MessageOverlay != null)
            {
                Ballz.The().MessageOverlay.HandleInput(inputMessage);
            }
            else
            {
                Input?.Invoke(this, inputMessage);                 //todo: use object pooling and specify message better
            }
        }
示例#23
0
 public UserControl(Ballz game, Session match, Ball ball) :
     base(game, match, ball)
 {
     AvailableWeapons.Add(new Weapons.Potato(ball, game));
     AvailableWeapons.Add(new Weapons.Grenade(ball, game));
     AvailableWeapons.Add(new Weapons.RopeTool(ball, game));
     AvailableWeapons.Add(new Weapons.Bazooka(ball, game));
     AvailableWeapons.Add(new Weapons.Pistol(ball, game));
     AvailableWeapons.Add(new Weapons.Waterbomb(ball, game));
     AvailableWeapons.Add(new Weapons.Drill(ball, game));
     Weapon             = AvailableWeapons[SelectedWeaponIndex];
     Ball.HoldingWeapon = AvailableWeapons[SelectedWeaponIndex].Icon;
 }
示例#24
0
 public UserControl(Ballz game, Session match, Ball ball):
     base(game, match, ball)
 {
     AvailableWeapons.Add(new Weapons.Potato(ball, game));
     AvailableWeapons.Add(new Weapons.Grenade(ball, game));
     AvailableWeapons.Add(new Weapons.RopeTool(ball, game));
     AvailableWeapons.Add(new Weapons.Bazooka(ball, game));
     AvailableWeapons.Add(new Weapons.Pistol(ball, game));
     AvailableWeapons.Add(new Weapons.Waterbomb(ball, game));
     AvailableWeapons.Add(new Weapons.Drill(ball, game));
     Weapon = AvailableWeapons[SelectedWeaponIndex];
     Ball.HoldingWeapon = AvailableWeapons[SelectedWeaponIndex].Icon;
 }
示例#25
0
文件: Server.cs 项目: webconfig/Ballz
        private void SendWorldState()
        {
            var entities = Ballz.The().Match.World.Entities;

            foreach (var e in entities)
            {
                Broadcast(e);
            }

            var sessionState = Ballz.The().Match.GetState();

            Broadcast(sessionState);
        }
示例#26
0
文件: Client.cs 项目: webconfig/Ballz
        public void Update(GameTime time)
        {
            NetIncomingMessage im;

            while ((im = Peer.ReadMessage()) != null)
            {
                // handle incoming message
                switch (im.MessageType)
                {
                case NetIncomingMessageType.DebugMessage:
                case NetIncomingMessageType.ErrorMessage:
                case NetIncomingMessageType.WarningMessage:
                case NetIncomingMessageType.VerboseDebugMessage:
                    Console.WriteLine($"NetMessage {im.MessageType}: {im.ReadString()}");
                    break;

                case NetIncomingMessageType.StatusChanged:
                    NetConnectionStatus status = (NetConnectionStatus)im.ReadByte();

                    if (status == NetConnectionStatus.Connected)
                    {
                        IsConnected = true;
                        Sync.AddConnection(im.SenderConnection);
                        Connected?.Invoke(this, null);
                        SendToServer(new LobbyPlayerGreeting {
                            PlayerName = Ballz.The().Settings.PlayerName
                        });                                                                                         // TODO: Use actual player name
                    }
                    else
                    {
                        IsConnected = false;
                    }

                    if (status == NetConnectionStatus.Disconnected)
                    {
                        Disconnected?.Invoke(this, null);
                    }

                    break;

                case NetIncomingMessageType.Data:
                    Sync.ReadMessage(im);
                    break;

                default:
                    Console.WriteLine($"Unhandled message type: {im.MessageType} {im.LengthBytes} bytes");
                    break;
                }
                Peer.Recycle(im);
            }
        }
示例#27
0
        public void LoadSettings()
        {
            var GameSettings = Ballz.The().Settings;

            EnableFullscreen.Checked = GameSettings.Fullscreen;
            PlayerName.Value         = GameSettings.PlayerName ?? "";
            if (Ballz.The().GetResolutions().Contains(Ballz.The().Settings.ScreenResolution))
            {
                Resolution.SelectedIndex = Ballz.The().GetResolutions().IndexOf(Ballz.The().Settings.ScreenResolution);
            }

            MasterVolume.Value = GameSettings.MasterVolume;
            MusicVolume.Value  = GameSettings.MusicVolume;
        }
示例#28
0
        public void StartNetworkGame(MatchSettings gameSettings, int localPlayerId)
        {
            if (Role == NetworkRole.Server)
            {
                server.StartNetworkGame(gameSettings);
            }
            else if (Role == NetworkRole.Client)
            {
                gameSettings.GameMode.InitializeSession(Ballz.The(), gameSettings);
                Ballz.The().Logic.StartGame(gameSettings, true, localPlayerId);
            }

            GameState = NetworkGameState.InGame;
        }
示例#29
0
        public BallControl(Ballz game, Session match, Ball ball)
        {
            Game  = game;
            Match = match;
            Ball  = ball;

            Weapon = new Weapons.RopeTool(ball, game);

            KeyPressed[InputMessage.MessageType.ControlsAction] = false;
            KeyPressed[InputMessage.MessageType.ControlsUp]     = false;
            KeyPressed[InputMessage.MessageType.ControlsDown]   = false;
            KeyPressed[InputMessage.MessageType.ControlsLeft]   = false;
            KeyPressed[InputMessage.MessageType.ControlsRight]  = false;
        }
示例#30
0
        public virtual void FireProjectile()
        {
            if (Ballz.The().Match.IsRemoteControlled)
            {
                return;
            }

            Game.Services.GetService <SoundControl>().PlaySound(SoundControl.BazookaSound);
            Shot newShot = CreateShot();

            ProjectileInAir = newShot;
            Game.Match.World.AddEntity(newShot);
            Ball.PhysicsBody.ApplyForce(-10000 * Ball.ShootCharge * newShot.Recoil * Ball.AimDirection);
        }
示例#31
0
        public OptionsMenu() : base("Options")
        {
            Skin = PanelSkin.Default;

            PlayerName.PlaceholderText = "Enter your Name";

            Resolution = new DropDown(new Vector2(0, 280));
            var resolutions = Ballz.The().GetResolutions();

            foreach (var resolution in resolutions)
            {
                Resolution.AddItem($"{resolution.Width}x{resolution.Height}");
            }

            LoadSettings();

            AddItem(new Label("Player Name:"));
            AddItem(PlayerName);

            AddItem(EnableFullscreen);

            AddItem(new Label("Screen Resolution:"));
            AddItem(Resolution);

            AddItem(new Label("Sound Volume:"));
            AddItem(MasterVolume);

            AddItem(new Label("Music Volume:"));
            AddItem(MusicVolume);

            var backButton = new MenuButton(
                "Back",
                size: new Vector2(0.5f, -1.0f),
                skin: ButtonSkin.Alternative,
                anchor: Anchor.BottomLeft,
                click: () => Ballz.The().Logic.MenuGoBack()
                );

            AddItem(backButton);
            var saveButton = new MenuButton(
                "OK",
                size: new Vector2(0.5f, -1.0f),
                skin: ButtonSkin.Alternative,
                anchor: Anchor.BottomRight,
                click: SaveSettings
                );

            AddItem(saveButton);
        }
示例#32
0
        public InputTranslator(Ballz game)
            : base(game)
        {
            Mode = InputMode.PROCESSED;
            PreviousKeyboardState = Keyboard.GetState();
            CurrentKeyboardState  = PreviousKeyboardState;
            previousGamePadState  = new GamePadState[4];

            gamePadPlayerIndex    = new PlayerIndex[4];
            gamePadPlayerIndex[0] = PlayerIndex.One;
            gamePadPlayerIndex[1] = PlayerIndex.Two;
            gamePadPlayerIndex[2] = PlayerIndex.Three;
            gamePadPlayerIndex[3] = PlayerIndex.Four;
            //previousGamePadState = GamePad.GetState(
        }
示例#33
0
        public InputTranslator(Ballz game)
            : base(game)
        {
            Mode = InputMode.PROCESSED;
            previousState = Keyboard.GetState();
            currentState = previousState;
            previousGamePadState = new GamePadState[4];

            gamePadPlayerIndex = new PlayerIndex[4];
            gamePadPlayerIndex[0] = PlayerIndex.One;
            gamePadPlayerIndex[1] = PlayerIndex.Two;
            gamePadPlayerIndex[2] = PlayerIndex.Three;
            gamePadPlayerIndex[3] = PlayerIndex.Four;
            //previousGamePadState = GamePad.GetState(
        }
示例#34
0
 public LogicControl(Ballz game)
 {
     Game = game;
     state = GameState.Unknown;
     ButtonRepeat = new Timer(62.5);
     ButtonRepeat.AutoReset = true;
     repeatHandler = (s,e)=>{};
     ButtonRepeat.Elapsed += repeatHandler;
     ButtonDelay = new Timer(1000);
     ButtonDelay.AutoReset = false;
     ButtonDelay.Elapsed += (s, e) =>
     {
         ButtonRepeat.Stop();
         ButtonRepeat.Start();
     };
 }
示例#35
0
 public LogicControl(Ballz game)
 {
     Game                   = game;
     state                  = GameState.Unknown;
     ButtonRepeat           = new Timer(62.5);
     ButtonRepeat.AutoReset = true;
     repeatHandler          = (s, e) => {};
     ButtonRepeat.Elapsed  += repeatHandler;
     ButtonDelay            = new Timer(1000);
     ButtonDelay.AutoReset  = false;
     ButtonDelay.Elapsed   += (s, e) =>
     {
         ButtonRepeat.Stop();
         ButtonRepeat.Start();
     };
 }
示例#36
0
        public override void OnTerrainCollision(Terrain terrain, Vector2 position)
        {
            if (Ballz.The().Match.IsRemoteControlled)
            {
                return;
            }

            float impact = 0.04f * Velocity.Length() * BulletHoleRadius;

            if (impact > 0.2)
            {
                // Destroy terrain and die
                terrain.SubtractCircle(position.X, position.Y, impact);
            }

            onAnyCollision();
        }
示例#37
0
        public void Explode()
        {
            if (ExplosionRadius <= 0.0f)
            {
                return;
            }

            Ballz.The().Match.World.StaticGeometry.SubtractCircle(Position.X, Position.Y, ExplosionRadius);

            Ballz.The().Match.World.GraphicsEvents.Add(new CameraShakeEffect {
                Intensity = 2f, Duration = 0.2f, Start = Ballz.The().Match.GameTime
            });
            Ballz.The().Match.World.GraphicsEvents.Add(SpriteGraphicsEffect.CreateExplosion(Ballz.The().Match.GameTime, Position, 0));

            // TODO: damage to all players within explosion radius
            foreach (var p in Ballz.The().Match.Players)
            {
                foreach (var b in p.OwnedBalls)
                {
                    if (Vector2.Distance(b.Position, this.Position) < ExplosionRadius)
                    {
                        if (!Ballz.The().Settings.FriendlyFire&& b.Player.TeamName == Team)
                        {
                            break;
                        }

                        b.ChangeHealth(-this.HealthDecreaseFromExplosionImpact * Vector2.Distance(b.Position, this.Position) / ExplosionRadius);

                        b.PhysicsBody.ApplyLinearImpulse(HealthDecreaseFromExplosionImpact *
                                                         Vector2.Distance(b.Position, this.Position) / ExplosionRadius *
                                                         Vector2.Normalize(b.Position - this.Position)
                                                         );
                    }
                }
            }

            if (ShotType == ShotType_T.Generating)
            {
                Ballz.The().Match.World.Water.AddParticles(this.Position, 20);
            }


            // Remove projectile
            Dispose();
        }
示例#38
0
 public ChargedProjectileWeapon(Ball ball, Ballz game)
     : base(ball, game)
 {
 }
示例#39
0
 public PhysicsControl(Ballz game)
     : base(game)
 {
     Game = game;
 }
示例#40
0
 public MenuRenderer(Ballz game, Item defaultMenu = null) : base(game)
 {
     Menu = defaultMenu;
 }
示例#41
0
 public SoundControl(Ballz game)
 {
     Game = game;
     loadedSounds = new Dictionary<string, SoundEffect>();
 }
示例#42
0
 public BaseRenderer(Ballz game)
     : base(game)
 {
     Game = game;
 }
示例#43
0
 public GameLogic(Ballz game, Session session)
     : base(game)
 {
     Game = game;
     Session = session;
 }
示例#44
0
 public DebugRenderer(Ballz _game) : base(_game)
 {
     Game = _game;
 }
示例#45
0
 public GameLogic(Ballz game)
     : base(game)
 {
     Game = game;
 }
示例#46
0
 public Potato(Ball ball, Ballz game) : base(ball, game) { }
示例#47
0
 public WeaponControl(Ball ball, Ballz game)
 {
     Ball = ball;
     Game = game;
 }
示例#48
0
 public WaterRenderer(Ballz game)
 {
     Game = game;
 }
示例#49
0
文件: Worms.cs 项目: SpagAachen/Ballz
        protected override Session ImplStartSession(Ballz game, GameSettings settings, bool remoteControlled, int localPlayerId)
        {
            var session = new Session(game, new World(new Terrain(settings.MapTexture)), settings)
                              {
                                  UsePlayerTurns = this.UsePlayerTurns,
                                  Terrain = new Terrain(settings.MapTexture)
                              };

            FindSpawnPoints(settings.MapTexture, session.Terrain.Scale);

            var spawnPoints = SelectSpawnpoints(settings.Teams.Select(t=>t.NumberOfBallz).Sum());

            // Create players and Ballz
            var currBallCreating = 0;
            foreach (var team in settings.Teams)
            {
                var player = new Player
                {
                    Id = team.Id,
                    Name = team.Name,
                    TeamName = team.Country,
                    IsLocal = !remoteControlled || localPlayerId == team.Id
                };

                session.Players.Add(player);

                var ballCount = UsePlayerTurns ? team.NumberOfBallz : 1;
                var ballNames = TeamNames.GetBallNames(team.Country, ballCount);

                for (var i = 0; i < ballCount; ++i)
                {
                    var playerBall = new Ball
                    {
                        Name = ballNames[i],
                        Position = spawnPoints[currBallCreating],
                        Velocity = new Vector2(0, 0),
                        IsAiming = true,
                        Player = player,
                        HoldingWeapon = "Bazooka",
                        IsStatic = false
                    };
                    player.OwnedBalls.Add(playerBall);
                    ++currBallCreating;
                    session.World.AddEntity(playerBall);

                    BallControl controller;

                    if (team.ControlledByAI)
                        controller = new AIControl(game, session, playerBall);
                    else
                        controller = new UserControl(game, session, playerBall);

                    session.SessionLogic.BallControllers[playerBall] = controller;

                }

                player.ActiveBall = player.OwnedBalls.FirstOrDefault();
                session.SessionLogic.ActiveControllers[player] = session.SessionLogic.BallControllers[player.ActiveBall];
            }

            return session;
        }
示例#50
0
 public DebugRenderer(Ballz _game) : base(_game)
 {
     Game = _game;
     WaterRenderer = new WaterRenderer(_game);
 }
示例#51
0
文件: Worms.cs 项目: SpagAachen/Ballz
 protected override void ImplInitializeSession(Ballz game, GameSession.Logic.GameSettings settings)
 {
     var mapTexture = MapName == "Generated" ? TerrainGenerator.GenerateTerrain(width,height): game.Content.Load<Texture2D>("Worlds/" + MapName);
     settings.MapName = MapName;
     settings.MapTexture = mapTexture;
 }
示例#52
0
 public abstract Session StartSession(Ballz game);
示例#53
0
		public Waterbomb(Ball ball, Ballz game) : base(ball, game) { }
示例#54
0
 public AIControl(Ballz game, Session match, Ball ball)
     : base(game, match, ball)
 {
     pistol = new Pistol(ball, game);
     bazoo = new Bazooka(ball, game);
 }
示例#55
0
 public Pistol(Ball ball, Ballz game)
     : base(ball, game)
 {
 }
示例#56
0
 public GameRenderer(Ballz game) : base(game)
 {
     WaterRenderer = new WaterRenderer(game);
     TeamTextures = new Dictionary<string, Texture2D>();
 }