So Tom, what have you been doing?
Good question Tom. I have been working on new top secret collision code. I'm trying to make it so we can have hills and such to walk up and down. This way our terrain feels more Earthly and less Tetrisy.
So it turns out I've been using trigonometry to do this. The idea is to get the x and y positions of the player when they land on the ground. Based on how high and far they are you can get the angle of the ground. Using crazy black magic they call atan. Once I have this I know which way to move the player. It's been working out pretty well so far. I have the player hitting the ground, and I have access to the angle of that ground. Now all I need is to be able to move the player based on this. When I left my code I was working on moving the player using sin and cos (more crazy black magic).
I have concerns. I'm accessing alot more variables then I thought I would. This means that there could be trouble when putting the two codes together. Hopefully everything will work out great.
Subscribe to:
Post Comments (Atom)
Sounds like some high level Voodoo Tom, and awesome. The only thing I can think of to ask, more for curiousities sake, is if the new code will use more memory?
ReplyDeleteRight now it doesn't seem like it. In fact if things go the way it seems it may improve the memory. The new code consists of one primary function with math formulas. The old code had about 5 while loops and 20 if statements.
ReplyDelete