Friday, February 22, 2013

Menu Screen and Trajectory Mapping

This week I worked with James in getting the Menu screen to work better.  I moved the "Delete Game State" into the Options bar and also re-factored the menu screen so that they can be made more simple and easier to read by other programmers.  The open source data we found online had the menu code but it was in the worst form to read and would take hours to just understand a menu screen before being able to add to it or create a similar game screen.

I also worked on trajectory plannings of static objects.  I sat down and wrote out the physics equations to get the trajectories to work the way I would want them to.  I was able to add constraints to the trajectory of objects using a cubic interpolation.  The equation I came up with to make smooth transitions used the constraints:


  • Initial Position = q_0
  • End Position = q_1
  • Initial Velocity = End Velocity = 0
  • Time Table = 0 .. 1
  • Position at time 0.5 = (q_0 + q_1)/2
  • Acceleration at time 0.5 = 0
The final equation solving for these constraints is:

q(t) = q_0 + (q_1 - q_0(3t^3 - 2t^3)

I'm excited to use these next few days to make dynamic moving objects in the game using this equation inside of the game.

No comments:

Post a Comment