Skip to content
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

问题反馈 #7

Open
mathsmatics opened this issue May 22, 2022 · 10 comments
Open

问题反馈 #7

mathsmatics opened this issue May 22, 2022 · 10 comments

Comments

@mathsmatics
Copy link

老哥,游戏界面什么的都做得可以,就是一点,按键有点难按,非得卡着那个点按下按键才能拐弯,可以优化一下这一点

@mumuy
Copy link
Owner

mumuy commented Jun 9, 2022

不是一个点,是1/2单元格的空间

@mathsmatics
Copy link
Author

速度有点快,稍微按早了就没响应,可以放宽点,提前就确定要转的方向

@rogerclarkmelbourne
Copy link

Normally, you can define the next direction before the next turning point.

e.g. When moving upwards, if you press left, then at the next time that a left turn is possible, then the player will turn left.

Google translate says...

通常,您可以在下一个转折点之前定义下一个方向。

例如 向上移动时,如果你按下左键,那么在下一次可以左转的时候,玩家就会左转。

@mumuy
Copy link
Owner

mumuy commented Sep 28, 2022

Actually, I did. I define the next direction before the next at 1/2 cell position.

@rogerclarkmelbourne
Copy link

rogerclarkmelbourne commented Sep 28, 2022

OK.

The existing version did not seem to accept a new direction until very close to the junction.

@mumuy
Copy link
Owner

mumuy commented Sep 28, 2022

'this.control.orientation' is equivalent to the property 'this.requestedOrientation' you submitted.

@rogerclarkmelbourne
Copy link

rogerclarkmelbourne commented Sep 28, 2022

something seems to constantly clear

this.control.orientation

I did not look at what makes it constantly 'undefined'

@rogerclarkmelbourne
Copy link

rogerclarkmelbourne commented Sep 28, 2022

Sorry.

I think I was confused

Its player.control.orientation which goes back to being undefined.

But I think with this.control.orientation, you code immediatly checks if the direction is valid, and if it is not valid this.control.orientation seems to be set to the current direction, so the input from player.control.orientation is lost :-(

@rogerclarkmelbourne
Copy link

I think this area of code changes the orientation

https://github.com/mumuy/pacman/blob/master/index.js#L869-L877

@mumuy
Copy link
Owner

mumuy commented Sep 29, 2022

Yes, The 'update' function updates the coordinates of an object. 'this.control.orientation' is used to store control parameters, meaning to cache the task that the object will execute

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants