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

多个水果同时碰撞的问题 #4

Open
mangoleaves opened this issue Dec 14, 2021 · 0 comments
Open

多个水果同时碰撞的问题 #4

mangoleaves opened this issue Dec 14, 2021 · 0 comments

Comments

@mangoleaves
Copy link

产生问题的情况

$B_1$, $B_2$, $B_3$是同类型的水果,$B_2$同时与$B_1$,$B_3$碰撞,会同时合并产生2个更高一级的水果,这两个水果又会合并产生高两级的水果。

问题

判断碰撞时,是一对一对检测的。第一对($B_1$,$B_2$)处理后,会删除$B_1$,$B_2$,再处理第二对时,没有检测$B_1$,$B_2$是否还存在,而直接生成了第二个更高一级的水果。

解决

增加检测当前碰撞对的水果是否都存在的判断,若任何一个不存在了,则不做任何操作。

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

1 participant