sschmid / Match-One

This is a simple and interactive Unity3d example project to show how to use Entitas
https://github.com/sschmid/Entitas
201 stars 55 forks source link

bug: array out of bounds crash when raycast is hitting hitbox of piec… #1

Closed misterHallodri closed 8 years ago

misterHallodri commented 9 years ago

…e that falls from y=9.5 and above (9.5f-10.0f) fix: floor raycasted screen positions to int + setting fall position for +0.999f

While the position of the falling piece has the value y+1 and the board height in the example is 8, the position of the hitbox of a piece will have values from 9 to 10. (y+1) Which result in an out of bounds exception when a piece above the board is hit while it's falling (only really happens in burst mode, but easily reproducable).

misterHallodri commented 9 years ago

This might not be the best bugfix. Probably better to create a hitbox component after the piece fell. But that would not work with the fun burst mode. :)

sschmid commented 8 years ago

I just updated Match-One to use Entitas 0.32.0. I completely replaced the GameBoardCache with the new EntityIndex feature. This most likely fixes this issue.