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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement basic collision detection #149

Open
3 tasks
fallenoak opened this issue Jun 6, 2016 · 1 comment
Open
3 tasks

Implement basic collision detection #149

fallenoak opened this issue Jun 6, 2016 · 1 comment

Comments

@fallenoak
Copy link
Member

fallenoak commented Jun 6, 2016

A friend was just commenting the other day about how Wowser looks great, but is lacking in the gameplay department. 馃槢

Let's fix that with some rudimentary collision detection for the player!

For now, let's skip the trickier parts of collision, and just deal with basic terrain collisions.

Progress

  • Check terrain intersections for the destination position when player navigates
    Prior to actually moving, but after the move event is triggered, we should calculate the terrain intersections for the down vector (0, 0, -1) at the destination position. We should then grab the Z position of any intersected terrain, and calculate the angle between the original unit position and the new position clamped to the Z position of the intersected terrain. Finally, we should return the new Z position and the angle value.
  • Deny movement with overly steep 'up' angle
    Any attempted movement in excess of some angle should be prevented.
  • Trigger falling for movement with overly steep 'down' angle
    Any attempted movement with a 'down' angle in excess of some value should cause falling. For now, falling can simply consist of lerping from [destination position without collision Z position applied] to the [destination position with collision Z value applied]. Not sure how we want to animate this, exactly.
@timkurvers
Copy link
Member

馃憤

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

No branches or pull requests

2 participants