Skip to content

Commit d788b37

Browse files
authored
trying to add dropping.
1 parent 912daec commit d788b37

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/scripts/EventHandler.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ class EventHandler {
1515
KeyA: 'left',
1616
Space: 'jump',
1717
ShiftLeft: 'sneak',
18-
KeyR: 'sprint'
18+
KeyR: 'sprint',
19+
KeyQ: 'drop'
1920
}
2021
this.keys = {}
2122
this.gameState = null
@@ -43,6 +44,9 @@ class EventHandler {
4344
focus = i - 1
4445
}
4546
}
47+
if (z.code === 'KeyQ') {
48+
this.game.socket.emit('drop')
49+
}
4650
if (z.code === 'Escape' && this.gameState === 'inventory') {
4751
this.setState('menu')
4852
}

0 commit comments

Comments
 (0)