Ejemplo n.º 1
0
 public ControllableShip(Vector2 position, Vector2 velocity)
 {
     Me = this;
     this.velocity = velocity;
     s = new Sprite(ContentStorageManager.Get<Texture2D>("Ship01"));
     s.CenterOriginOnTexture();
     s.position = position;
     ic = ContentStorageManager.Get<InputController>("input");
 }
Ejemplo n.º 2
0
        ScreenText st; //used to display PAUSE while paused

        #endregion Fields

        #region Constructors

        public GameplayState(Game game)
            : base(game)
        {
            Game1 g = (Game1)game;

            input = ContentStorageManager.Get<InputController>("input");

            st = new ScreenText("Courier", "PAUSE", new Vector2(2, 2), new Vector2(300, 300));//initialize the PAUSE text

            //Create and set pause buttons
            Dictionary<string, ImageButton.Callback> menuButtons = new Dictionary<string, ImageButton.Callback>();
            menuButtons.Add("PauseResume", resumeButton);
            menuButtons.Add("MainMenuQuit", quitButton);

            //initialize menu
            pauseMenu = new Menu(g, menuButtons, HLayout.Center, VLayout.Bottom, new Vector2(300, 300), 10);

            player = new ControllableShip(new Vector2(Game1.ScreenSize.X / 2, Game1.ScreenSize.Y / 2), new Vector2(10, 10));
            parasite = new Parasite(player.Position, new Vector2(8,8));
            parasite.controlShip = player;
            level = new Level(1);
            // this method (level.Generate()) will be called when the level is needed to change. For now, its here.
            level.GenerateLevel(level.current_level);
        }