Case 5: "Creating a more advanced groundline to move along, and gravity physics for jumping".
Since I was totally put out of play by my appendix surgery during the "Case 5 week" there's not really much I can say about what went on at school and with the others, but I did complete the case nonetheless. In the process of creating a new, more curvy ground that my fighter could move along, I also created some background art to go along with it (which you can see here). It just seemed like the right thing to do. I got some tips from Svein, and by using a while loop checking when the ground and the fighter touched, I could keep him on the ground by pushing against gravity, which was pushing down on the y-axis. During the previous cases I had already implemented simple gravity physics, as is demonstrated in my Case 4 post.
Additionally I can share my solution to a problem i have run into a lot in my code in general, which is getting the right animations to play in the right situation. Like getting the idle animation to only play while my character is on the ground and not doing anything else. What I have done is just use a lot of if(!jumping && !attacking && !drooling) conditionals, that check if "activity variables" I have created are false. So in this case if my character is NOT jumping, attacking or ...drooling, he will be idle. Hope that helps someone out there. Stay tuned for more rapport-ish posts this weekend.
No comments:
Post a Comment