
The object of case 5 was to make the character jump, make the program test if the character is on the ground or in the air and create invisible borders so that the character will not be able to walk off the ground.
This case gave me a slight nut to crack in the form of several lines of code that were doing the same. Seeing as I've been continuously updating my code since case 2, I had some code from case 4 that was basically the same as a new function I created for case 5. This meant that I had two sets of instructions that said the same, and therefore they collided with each other. Additionally, this caused my border statements to not work, meaning that my character walked straight off the ground when he reached the edge. My solution to these problems was actually quite easy: I deleted the code from case 4.
I then tested my program, and it worked perfectly! In the back of my head I could hear "Yatta, watashi wa kattaze!"
I am very satisfied with all my work so far, even though my character doesn't look as nice as I want him to be. He WILL be dreamy though, that's for sure. Pretty as can be!
Try the jumping and stuff here
Ingen kommentarer:
Legg inn en kommentar