-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Character Movement Getting Stuck #2
Comments
it's a logic problem. if (
) {
it scans from w to a, so now u click right (d key) it work. Now you want lock only one key maybe you can lock in addEventListener window.addEventListener("keydown", (KeyboardEvent) => {
} |
Hey @hunick1234 I may not have described my issue clearly earlier. My problem is that when I keep pressing the right arrow key (d) and then press the up arrow key (w) or the down arrow key (s), my character stops moving altogether, whereas in normal gameplay, with the previous arrow key still held down (in this case, the right arrow key), it should continue moving in that direction even if I continuously click the up or down arrow keys. So, it's not that it doesn't work after clicking the left arrow key (a), because in the aforementioned situation, clicking the left arrow key (a) does work. Thank you very much for discussing this with me, and I welcome further exploration. BR, |
Se finalizó la base del archivo CSS, acercándonos un poco más a la conclusión de la misma.
ha-ha bro this world is small ,isn't it.
I'm watched your GitHub page and there is a little surprise.
yea 其實我們可以用中文討論 請原諒我的破英文
|
嗨!你好!看起來我們確實有相同的語言共通性。 沒問題,非常感謝你熱心的回應,以下是我上述回應的中文原文: 我可能之前沒有描述好,我的問題是當我今天一直按 所以並非是再點擊 非常感謝你熱心地和我討論,也非常歡迎做後續的探討。 BR, |
謝謝您的翻譯
我不確定您是否有更改程式碼,
在程式碼的片段中,當按鍵為true的狀態下,角色都應該要是可移動的。 您有試著將鍵盤狀態列印出來看嗎?
1chooo ***@***.***> 於 2023年5月12日 週五 23:38 寫道:
… @hunick1234 <https://github.com/hunick1234>
嗨!你好!
沒問題,非常感謝你熱心的回應,以下是我上述回應的中文原文:
我可能之前沒有描述好,我的問題是當我今天一直按右鍵(d)不放開的情況下,按了上鍵(w),以及按了下鍵(s)
人物就停留在原地不動了,然而正常遊戲操作會在前一個按鍵不放開的前提下,這邊是拿右鍵(d)做舉例,就算連續點擊上鍵(w)及下鍵(s),也應該要繼續往右。
所以並非是再點擊左鍵(a)後不會運作,因為在上述情況下,點擊左鍵(a)是會運作的。
非常感謝你熱心地和我討論,也非常歡迎做後續的探討。
BR,
@1chooo <https://github.com/1chooo>
—
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AOFRASDSSBHPR7HHK4ABU5DXFZKOLANCNFSM6AAAAAAXTMCQ5M>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Descriptions
Thank you very much for open sourcing this project, and also for the tutorial on YouTube. However, I encountered an issue while playing and submitted an issue report. The problem is that if I move to the right and suddenly click up or down, the character will get stuck and cannot continue moving to the right. The same issue occurs when moving in any of the four directions.
How to reproduce
The video situation
Screen.Recording.2023-05-03.at.1.51.17.AM.mov
The text was updated successfully, but these errors were encountered: