Sunday, April 24, 2011

Week 1 Advanced Game Prototyping

This week, I had to continue working out the asteriod code. Besides additional coding, the frame work of the previous coding was left alone. I changed the HP check code on the asteriods from a called function to fixedupdate and added a tag check and the new asteriods to spawn from the destroyed ones worked. What I spent most of my 5+ hours on was the movement issues, nothing was mentioned about a Constant Force component with using the constant force physics vs addforce physics. I learned that addforce diffenently needed a Rigidbody component to run, but with how my movement code is done I believe for the constant forces both Rigidbody and Constant Force components are needed. Though the way Constant Force is worded as a one time force vs addforce which is added ever frame, I had to add a code that would zero out the random constant force after 5 seconds to prevent the asteriods form jerking around.

No comments:

Post a Comment