Exemplo n.º 1
0
        public static Vector3 getPlayerAimingAtPointAtDistance(float distance, MouseState mouseState)
        {
            Vector3 far = new Vector3(mouseState.X, mouseState.Y, distance);

            far = Compositer.device.Viewport.Unproject(far, Compositer.getPerspectiveMatrix(2000), Compositer.viewMatrix, Matrix.Identity);
            return(far);
        }
Exemplo n.º 2
0
        public void Draw(SpriteBatch spriteBatch)
        {
            Compositer.UpdateViewMatrix(player.getCameraLoc(), player.getCameraRotation());
            Compositer.drawFinalImageFirst(player, false);
            Compositer.display(world, player, player.getControlledCharacter());

            spriteBatch.Begin();//0, BlendState.Opaque, null, null, null, Compositer.effectToUse);
            IConsole.display(spriteBatch, Main.graphics.PreferredBackBufferWidth, Main.graphics.PreferredBackBufferHeight);
            player.display2D(spriteBatch);
            spriteBatch.End();
        }
Exemplo n.º 3
0
        public void display3D()
        {
            if (isEmbodyingCharacter())
            {
                if (selectedCharacter.isCarryingItem())
                {
                    ResourceBlock.ResourceType type = selectedCharacter.getLoad();
                    String  blockChrPath            = ResourceBlock.getPathForResourceType(type);
                    Vector3 centerOfFloatingCube    = getPlayerAimingAtPointAtDistance(.7f, currentMouseState);

                    WorldMarkupHandler.addFlagPathWithPosition(blockChrPath, centerOfFloatingCube, 1f / 7f / 12f);
                }
            }

            if (selectedCharacter != null && !isEmbodyingCharacter())
            {
                Compositer.addFlagForThisFrame(selectedCharacter.getLocation() + new Vector3(0, 1.1f, 0), "white");
            }
        }
 public ThirdPersonInputHandler()
 {
     selectedBlockType     = 7;
     currentMenu           = MenuScreen.getThirdPersonHud(Compositer.getScreenWidth(), Compositer.getScreenHeight());
     currentInterfaceState = InterfaceStates.playing;
 }
Exemplo n.º 5
0
 public void switchToColorPallete()
 {
     currentMenu = MenuScreen.getColorPalleteInterface(Compositer.getScreenWidth(), Compositer.getScreenHeight());
 }
Exemplo n.º 6
0
 public void closeColorPallete()
 {
     currentMenu = MenuScreen.getThirdPersonHud(Compositer.getScreenWidth(), Compositer.getScreenHeight());
 }
Exemplo n.º 7
0
 public void openMainMenu()
 {
     currentMenu = MenuScreen.getMainMenuInterface(Compositer.getScreenWidth(), Compositer.getScreenHeight());
     setInterfaceState(PlayerInputHandler.InterfaceStates.inMainMenu);
 }
Exemplo n.º 8
0
 void closeMainMenu()
 {
     currentMenu = MenuScreen.getThirdPersonHud(Compositer.getScreenWidth(), Compositer.getScreenHeight());
     setInterfaceState(PlayerInputHandler.InterfaceStates.playing);
 }
Exemplo n.º 9
0
 public void display2D(SpriteBatch spriteBatch)
 {
     if (inputHandler.getCurrentMenu() != null)
     {
         inputHandler.getCurrentMenu().display(spriteBatch, new Vector2(currentMouseState.X, currentMouseState.Y), Compositer.getScreenWidth(), Compositer.getScreenHeight());
     }
     if (isEmbodyingCharacter())
     {
         spriteBatch.Draw(ContentDistributor.crossReticle, new Rectangle(Compositer.device.Viewport.Width / 2 -
                                                                         ContentDistributor.crossReticle.Width / 2, Compositer.device.Viewport.Height / 2 - ContentDistributor.crossReticle.Height / 2,
                                                                         ContentDistributor.crossReticle.Width, ContentDistributor.crossReticle.Height), Color.White);
     }
 }
Exemplo n.º 10
0
 public FirstPersonInputHandler(Character nSelectedCharacter)
 {
     currentMenu       = MenuScreen.getFirstPersonHud(Compositer.getScreenWidth(), Compositer.getScreenHeight());
     embodiedCharacter = nSelectedCharacter;
 }
Exemplo n.º 11
0
 public void LoadContent(ContentManager content)
 {
     Compositer.LoadContent(content);
     player.loadContent();
     SoundsManager.setPlayer(player);
 }