Ejemplo n.º 1
0
 private void initilizeOnFirstRun()
 {
     if (m_FirstRun)
     {
         CollisionsManager collisionsManager = new CollisionsManager(this.Game);
         m_FirstRun = false;
     }
 }
Ejemplo n.º 2
0
 protected virtual void InitServices()
 {
     GameSettings      = new GameSettings(this);
     InputManager      = new InputManager(this);
     CollisionsManager = new CollisionsManager(this);
     RandomBehavior    = new RandomBehavior(this);
     ScoreManager      = new ScoreManager(this);
     SoundManager      = new SoundManager(this);
 }
Ejemplo n.º 3
0
    private void OnCollisionEnter2D(Collision2D col)
    {
        CollisionsManager.ResolveCollision(this.gameObject, col.gameObject, col);

        // For moving the player with the platform
        if (col.gameObject.CompareTag("Ground"))
        {
            transform.SetParent(col.gameObject.transform);
        }
    }
Ejemplo n.º 4
0
        public SpaceInvaders()
        {
            m_Graphics            = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";
            InputManager.InputManager inputMgr = new InputManager.InputManager(this);
            m_GameManager = new GameManager.GameManager(this);
            CollisionsManager CollisionsMgr = new CollisionsManager(this);

            m_SpaceShips = new List <SpaceShip>();
            TexturePixelsManager TexturePixelsMgr = new TexturePixelsManager(this);
        }
 public SpaceInvadersGameScreen(GameStructure i_Game) : base(i_Game)
 {
     this.BlendState = Microsoft.Xna.Framework.Graphics.BlendState.NonPremultiplied;
     m_IsGameStarted = false;
     initDefaultData();
     m_CurrentLevel      = 1;
     m_CollisionsManager = Game.Services.GetService(typeof(ICollisionsManager)) as CollisionsManager;
     m_GamePauseScreen   = new GamePauseScreen(Game as GameStructure);
     m_GameOverSound     = SoundFactoryMethod.CreateSound(Game as GameStructure, eSoundName.GameOver);
     m_LevelWinSound     = SoundFactoryMethod.CreateSound(Game as GameStructure, eSoundName.LevelWin);
     m_BackGroundMusic   = SoundFactoryMethod.CreateSound(Game as GameStructure, eSoundName.BackgroundMusic);
 }
Ejemplo n.º 6
0
        public SpaceInvaders() : base()
        {
            m_ScreensMananger = new ScreensMananger(this);
            InputManager      inputManager      = new InputManager(this);
            CollisionsManager collisionsManager = new CollisionsManager(this);
            SettingsManager   settingsManager   = new SettingsManager(this);
            SoundsManager     soundsManager     = new SoundsManager(this);

            m_ScreensMananger.Push(new GameOverScreen(this));
            m_ScreensMananger.Push(new SpaceInvadersGameScreen(this));
            m_ScreensMananger.SetCurrentScreen(new WelcomeScreen(this));
        }
Ejemplo n.º 7
0
        protected override void Initialize()
        {
            m_InputManager = new InputManager(this);
            this.Services.AddService(typeof(InputManager), m_InputManager);

            m_CollisionManager = new CollisionsManager(this);
            this.Services.AddService(typeof(CollisionsManager), m_CollisionManager);

            m_SoundsManager = new SoundManager(this);
            this.Services.AddService(typeof(SoundManager), m_SoundsManager);

            base.Initialize();
        }
Ejemplo n.º 8
0
        public SpaceInvaders()
        {
            r_Graphics            = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";
            this.Window.Title     = "Space Invaders";

            r_InputManager      = new InputManager(this);
            r_CollisionsManager = new CollisionsManager(this);
            r_Settings          = new SpaceInvadersSettings(this);

            r_ScreensManager = new ScreensMananger(this, r_Graphics);
            r_ScreensManager.Push(new GameOverScreen(this));
            r_ScreensManager.SetCurrentScreen(new WelcomeScreen(this));
        }
Ejemplo n.º 9
0
        public GamePlayScreen(Game game, GameStateManager manager, InventoryManager inventoryManager)
            : base(game, manager)
        {
            this.inventoryManager  = inventoryManager;
            this.hudManager        = new HUDManager();
            this.commandManager    = new CommandManager();
            this.popUpManager      = PopUpManager.CreateInstance(game);
            this.collisionsManager = new CollisionsManager();
            this.missionManager    = MissionManager.GetInstance();
            this.dialogueManager   = DialogueManager.GetInstance();

            PlayerPositionChanged += this.missionManager.OnUpdateEvent;

            player        = new Player(game);
            isPaused      = false;
            drawEquipment = false;
        }
Ejemplo n.º 10
0
        public InvadersGame()
        {
            this.m_Graphics       = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";
            IInputManager      inputManager      = new InputManager(this);
            IPlayersManager    livesManager      = new PlayersManager(this);
            ICollisionsManager collisionsManager = new CollisionsManager(this);
            IScreensManager    screensManager    = new ScreensManager(this);

            m_SoundManager = new LocalSoundManager(this);
            IGameSettingsManager IGameSettingsManager = new GameSettingsManager(this);

            screensManager.SetCurrentScreen(new WelcomeScreen(this));

            this.m_Graphics.IsFullScreen              = true;
            this.m_Graphics.PreferredBackBufferWidth  = 800;
            this.m_Graphics.PreferredBackBufferHeight = 480;
            this.m_Graphics.SupportedOrientations     = DisplayOrientation.LandscapeLeft;
        }
 public SpaceInvaders()
 {
     m_CollisionManager     = new CollisionsManager(this);
     s_RandomNum            = new Random();
     this.m_Background      = new Background(this, @"Sprites\BG_Space01_1024x768", 1);
     this.m_Graphics        = new GraphicsDeviceManager(this);
     Content.RootDirectory  = "Content";
     this.m_MotherSpaceShip = new MotherSpaceShip(this);
     this.m_EnemysGroup     = new EnemiesGroup(this);
     Components.Add(this.m_EnemysGroup);
     this.IsMouseVisible = true;
     m_InputManager      = new InputManager(this);
     m_Players           = new List <Player>(2);
     m_Players.Add(new Player(this, PlayerIndex.One, Keys.H, Keys.K, Keys.U, true, new Vector2(0, 0)));
     m_Players.Add(new Player(this, PlayerIndex.Two, Keys.A, Keys.D, Keys.W, false, new Vector2(1, 0)));
     Components.Add(m_Players[0]);
     Components.Add(m_Players[1]);
     m_GameEngine         = new GameEngine(this);
     m_GameEngine.Players = m_Players;
 }
Ejemplo n.º 12
0
        public SpaceInvaders()
        {
            m_Graphics = new GraphicsDeviceManager(this);
            m_Graphics.PreferredBackBufferWidth  = GameSettings.sr_DefaultScreenWidth;
            m_Graphics.PreferredBackBufferHeight = GameSettings.sr_DefaultScreenHeight;
            Content.RootDirectory = "Content";
            m_ScreensMananger     = new ScreensManager(this);
            m_ScreensMananger.GraphicsDeviceManager = m_Graphics;
            m_ScreensMananger.Push(new GameOverScreen(this));
            m_ScreensMananger.Push(new PlayScreen(this));
            m_ScreensMananger.Push(new TransitionScreen(this, 1));
            m_ScreensMananger.SetCurrentScreen(new WelcomeScreen(this));
            InputManager      inputManager     = new InputManager(this);
            CollisionsManager collisionManager = new CollisionsManager(this);
            SoundManager      soundManager     = new SoundManager(this);

            soundManager.InitSoundEffects(GameSettings.s_SoundEffectsNames.Values.ToList(), GameSettings.s_BackgroundSoundName);
            soundManager.InitDefaultVolumes(GameSettings.sr_DefaultBGVolume, GameSettings.sr_DefaultSoundEffectVolume);
            IsMouseVisible = true;
        }
Ejemplo n.º 13
0
 private void OnCollisionEnter2D(Collision2D col)
 {
     CollisionsManager.ResolveCollision(this.gameObject, col.gameObject, col);
 }
Ejemplo n.º 14
0
    private void OnCollisionEnter2D(Collision2D col)
    {
        CollisionsManager.ResolveCollision(this.gameObject, col.gameObject, col);

        //Debug.Log("Player has collided with: " + col.collider.name);
    }