Thursday, September 11, 2014

Thursday, September 11th

Things for me are getting very very complicated. Today I tried to work on the continuation of a video that I had already started watching at home - how to add a counter to my game. I also tried to figure out a problem that also came up at home- whenever I would run the game, a million turtles would come and keep coming into the world.

The first problem with the turtles, I started having at home. My original intention was that every time a snake ate a baby, a new turtle would come into the world. Even if I didn't have babies in the world, the turtles would keep on coming and coming and they would fill up the screen. Turns out ( thanks to the help of Mr. Daly) that I had made the mistake of putting the action " createNewTurtle() " into the actions. When I run something, it is doing "act" over and over again. Therefore, it was doing act over and over again, and it added turtles over and over again to the world. In the end, the solution was to take out the " createNewTurtle " from the public void act.

Next, I wanted to modify something about my game. I realised that the game would stop once 9 turtles were eaten. But what about when the snake eats a baby and a new turtle comes into the world? I want the game to finish when all the turtles in the world are eaten, not only the 9 that are there in the beginning. I think that this is a problem of adding a line that makes the addition of turtles eaten be deducted by one point. I wasn't sure of how to do this, and neither was Mr. Daly, so I sent him an email with my code. I hope that he helps me to find a solution to this problem as soon as possible.

The third issue really frustrated me, and I still haven't figured out the problem. It was adding a counter to the game. Although I followed every instruction that he mentioned in the video, it didn't work. The first time that it didn't work, I realised that it was because my game was different than his! Although I follow all of what he teaches us in the Joy of Code videos, I like to change things up a bit and make the game more of my own instead of simply copying and pasting the code from the video into my Greenfoot. So after I realised I had to take his instructions and apply them differently since I have a different game, I got stuck. Once again I called Mr. Daly over to help me and we thought about it together, but we couldn't seem to find a solution. There were a lot of issues that I don't even understand well enough to explain on here. I tried to re watch some parts of the video that explained what to do, but still no luck. I will ask some people like Evan to maybe give me a hand tomorrow.

In the near future I really hope to get rid of these problems in my code. It makes me angry to think that I could be a lot farther ahead in his playlist, but I am stuck having to fix these problems. When I do finally get back on track, what I will do is try to do more exactly as he says in the videos. This is so that next time, I don't get stuck with problems that he doesn't resolve in the videos and that I don't have sufficient knowledge to fix myself.

No comments:

Post a Comment