コード例 #1
0
ファイル: Player.cs プロジェクト: HImports/IslandGame
        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);
        }
コード例 #2
0
ファイル: Game.cs プロジェクト: HImports/IslandGame
        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();
        }
コード例 #3
0
ファイル: Player.cs プロジェクト: HImports/IslandGame
        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");
            }
        }
コード例 #4
0
 public ThirdPersonInputHandler()
 {
     selectedBlockType     = 7;
     currentMenu           = MenuScreen.getThirdPersonHud(Compositer.getScreenWidth(), Compositer.getScreenHeight());
     currentInterfaceState = InterfaceStates.playing;
 }
コード例 #5
0
 public void switchToColorPallete()
 {
     currentMenu = MenuScreen.getColorPalleteInterface(Compositer.getScreenWidth(), Compositer.getScreenHeight());
 }
コード例 #6
0
 public void closeColorPallete()
 {
     currentMenu = MenuScreen.getThirdPersonHud(Compositer.getScreenWidth(), Compositer.getScreenHeight());
 }
コード例 #7
0
 public void openMainMenu()
 {
     currentMenu = MenuScreen.getMainMenuInterface(Compositer.getScreenWidth(), Compositer.getScreenHeight());
     setInterfaceState(PlayerInputHandler.InterfaceStates.inMainMenu);
 }
コード例 #8
0
 void closeMainMenu()
 {
     currentMenu = MenuScreen.getThirdPersonHud(Compositer.getScreenWidth(), Compositer.getScreenHeight());
     setInterfaceState(PlayerInputHandler.InterfaceStates.playing);
 }
コード例 #9
0
ファイル: Player.cs プロジェクト: HImports/IslandGame
 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);
     }
 }
コード例 #10
0
 public FirstPersonInputHandler(Character nSelectedCharacter)
 {
     currentMenu       = MenuScreen.getFirstPersonHud(Compositer.getScreenWidth(), Compositer.getScreenHeight());
     embodiedCharacter = nSelectedCharacter;
 }
コード例 #11
0
ファイル: Game.cs プロジェクト: HImports/IslandGame
 public void LoadContent(ContentManager content)
 {
     Compositer.LoadContent(content);
     player.loadContent();
     SoundsManager.setPlayer(player);
 }