Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Guangjun Jia
FlappyBird
Commits
de7e2089
Commit
de7e2089
authored
Feb 09, 2021
by
Levi
Browse files
fix: wrong value of keycode
parent
eb44ec32
Changes
1
Show whitespace changes
Inline
Side-by-side
src/main/java/com/kingyu/flappybird/app/Game.java
View file @
de7e2089
...
...
@@ -66,7 +66,7 @@ public class Game extends Frame {
class
BirdKeyListener
implements
KeyListener
{
// 按键按下,根据游戏当前的状态调用不同的方法
public
void
keyPressed
(
KeyEvent
e
)
{
int
keycode
=
e
.
getKeyC
har
();
int
keycode
=
e
.
getKeyC
ode
();
switch
(
gameState
)
{
case
GAME_READY:
if
(
keycode
==
KeyEvent
.
VK_SPACE
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment