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

Bullet doesn't always hit a robot #13

Open
mrhead opened this issue Dec 11, 2013 · 2 comments
Open

Bullet doesn't always hit a robot #13

mrhead opened this issue Dec 11, 2013 · 2 comments
Milestone

Comments

@mrhead
Copy link
Owner

mrhead commented Dec 11, 2013

Well I am not sure how to explain this ;).

Anyway it can happen that bullet will not hit static (not moving) robot even if it should.

For example, let say that bullet speed is 10 pixels per tick. If bullet is on pixel 1 and part of the robot is on pixels 3-8, then on next tick bullet will be on pixel 11 without hitting a robot...

@abinoam
Copy link
Contributor

abinoam commented Dec 28, 2013

That's an X-Ray bullet? ;-)

@mrhead
Copy link
Owner Author

mrhead commented Dec 28, 2013

:D

Now I know where exactly is the problem, but I need to figure out how to fix it.

Imagine this with bullet speed 100 (units per tick)

tick, bullet(x, y, heading), robot(x,y)

tick 0: bullet(0, 0, 90), robot(30, 0)
tick 1: bulltet(100, 0, 90), robot(30, 0)

So after one tick bullet just "jumped" over the robot and there is no collision detected. So fix is to check also traveled trajectory of bullet if there is any collision with bullet.

Sorry if I am not clear enough, but I am doing my best :D

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

2 participants