File tree Expand file tree Collapse file tree
Tutorials/learn-monogame-2d/src
11-Input-Management/MonoGameLibrary
12-Collision-Detection/MonoGameLibrary
13-Tilemap/MonoGameLibrary
14-SoundEffects-And-Music/MonoGameLibrary
15-Audio-Controller/MonoGameLibrary
16-Working-With-SpriteFonts/MonoGameLibrary
17-Scenes/DungeonSlime/Scenes Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -112,7 +112,7 @@ protected override void Update(GameTime gameTime)
112112 // Update the input manager
113113 Input . Update ( gameTime ) ;
114114
115- if ( ExitOnEscape && Input . Keyboard . IsKeyDown ( Keys . Escape ) )
115+ if ( ExitOnEscape && Input . Keyboard . WasKeyJustPressed ( Keys . Escape ) )
116116 {
117117 Exit ( ) ;
118118 }
Original file line number Diff line number Diff line change @@ -112,7 +112,7 @@ protected override void Update(GameTime gameTime)
112112 // Update the input manager
113113 Input . Update ( gameTime ) ;
114114
115- if ( ExitOnEscape && Input . Keyboard . IsKeyDown ( Keys . Escape ) )
115+ if ( ExitOnEscape && Input . Keyboard . WasKeyJustPressed ( Keys . Escape ) )
116116 {
117117 Exit ( ) ;
118118 }
Original file line number Diff line number Diff line change @@ -112,7 +112,7 @@ protected override void Update(GameTime gameTime)
112112 // Update the input manager
113113 Input . Update ( gameTime ) ;
114114
115- if ( ExitOnEscape && Input . Keyboard . IsKeyDown ( Keys . Escape ) )
115+ if ( ExitOnEscape && Input . Keyboard . WasKeyJustPressed ( Keys . Escape ) )
116116 {
117117 Exit ( ) ;
118118 }
Original file line number Diff line number Diff line change @@ -112,7 +112,7 @@ protected override void Update(GameTime gameTime)
112112 // Update the input manager
113113 Input . Update ( gameTime ) ;
114114
115- if ( ExitOnEscape && Input . Keyboard . IsKeyDown ( Keys . Escape ) )
115+ if ( ExitOnEscape && Input . Keyboard . WasKeyJustPressed ( Keys . Escape ) )
116116 {
117117 Exit ( ) ;
118118 }
Original file line number Diff line number Diff line change @@ -132,7 +132,7 @@ protected override void Update(GameTime gameTime)
132132 // Update the audio controller.
133133 Audio . Update ( ) ;
134134
135- if ( ExitOnEscape && Input . Keyboard . IsKeyDown ( Keys . Escape ) )
135+ if ( ExitOnEscape && Input . Keyboard . WasKeyJustPressed ( Keys . Escape ) )
136136 {
137137 Exit ( ) ;
138138 }
Original file line number Diff line number Diff line change @@ -132,7 +132,7 @@ protected override void Update(GameTime gameTime)
132132 // Update the audio controller.
133133 Audio . Update ( ) ;
134134
135- if ( ExitOnEscape && Input . Keyboard . IsKeyDown ( Keys . Escape ) )
135+ if ( ExitOnEscape && Input . Keyboard . WasKeyJustPressed ( Keys . Escape ) )
136136 {
137137 Exit ( ) ;
138138 }
Original file line number Diff line number Diff line change @@ -249,11 +249,11 @@ private void AssignRandomBatVelocity()
249249
250250 private void CheckKeyboardInput ( )
251251 {
252- // Get a reference to the keyboard inof
252+ // Get a reference to the keyboard info
253253 KeyboardInfo keyboard = Core . Input . Keyboard ;
254254
255255 // If the escape key is pressed, return to the title screen
256- if ( Core . Input . Keyboard . WasKeyJustPressed ( Keys . Escape ) )
256+ if ( keyboard . WasKeyJustPressed ( Keys . Escape ) )
257257 {
258258 Core . ChangeScene ( new TitleScene ( ) ) ;
259259 }
You can’t perform that action at this time.
0 commit comments