I went into this part of programming knowing partialy what I wanted. I had sudo coded it in a small if stement and Tom was a big help with writing it out properly and for showing me his code flow structure. I managed to reach a point I didn't think I would today.
The game will crash if you pick up more than two materials for some reason and it still give you material for steping on them without picking them up but it does let you win if you get to the pipe with 100 material and not before.
Im not sure how it works like this right now and it still fixes it before you reach the pipe but it will only let you pass when you reach the pipe and have 100 material and thats something.
Its frustrating me so much right. Im trying right now to clean up the errors I have created before moving on, because even though it will sort of work it's buggy to the point were it seems to just work by luck.
I don't see how any of the code you posted would break it and cause the issue although I don't see why you need two seperate functions to win the game.
ReplyDeleteWhy do you have two if statements that check whether or not the material is at 100 and 125 in two different functions?