rm KeyboardInput
GitOrigin-RevId: 1725d577c5be04488a6723b65c0c93fa25d12ab5
This commit is contained in:
parent
660d163119
commit
361a02c67f
@ -1,24 +0,0 @@
|
|||||||
using Microsoft.Xna.Framework.Input;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
namespace SemiColinGames {
|
|
||||||
public class KeyboardInput {
|
|
||||||
private KeyboardState oldState = Keyboard.GetState();
|
|
||||||
private List<Keys> newKeysDown = new List<Keys>();
|
|
||||||
|
|
||||||
public void Update() {
|
|
||||||
KeyboardState newState = Keyboard.GetState();
|
|
||||||
newKeysDown.Clear();
|
|
||||||
foreach (Keys k in newState.GetPressedKeys()) {
|
|
||||||
if (!oldState.IsKeyDown(k)) {
|
|
||||||
newKeysDown.Add(k);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
oldState = newState;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<Keys> NewKeysDown() {
|
|
||||||
return newKeysDown;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -14,7 +14,6 @@
|
|||||||
<Compile Include="$(MSBuildThisFileDirectory)FpsCounter.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)FpsCounter.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)History.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)History.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)IDisplay.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)IDisplay.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)KeyboardInput.cs" />
|
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Player.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Player.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)SneakGame.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)SneakGame.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)World.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)World.cs" />
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
<Compile Include="History.cs" />
|
<Compile Include="History.cs" />
|
||||||
<Compile Include="IDisplay.cs" />
|
<Compile Include="IDisplay.cs" />
|
||||||
<Compile Include="SneakGame.cs" />
|
<Compile Include="SneakGame.cs" />
|
||||||
<Compile Include="KeyboardInput.cs" />
|
|
||||||
<Compile Include="Player.cs" />
|
<Compile Include="Player.cs" />
|
||||||
<Compile Include="World.cs" />
|
<Compile Include="World.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
Loading…
Reference in New Issue
Block a user