Monday, May 9, 2011

5/9/11 - First Real Use and Programming of Greenfoot

Today was a very productive day in terms of using and understanding greenfoot.  Stavros was able to make the greenfoot program work almost immediately after he came.  This gave Safath and I a lot of time to play around with greenfoot and actually compile the code.  First we had the wombat class go around and eat leaves(which it was already programmed to do).  After having greenfoot run some of the most basic classes, we tried to create a new 'Man' class, with a person that would eat the wombats.  At first, we had problems with the man class because we were not able to make it show up on the greenfoot grid.  We tried different solutions in trying to fix this problem such as changing the picture of the man class, change some of the code and also change it so it was a subclass of the different classes such as the wombat and the leaf, but none of which worked.  So we decided to scrap the whole project and start a new greenfoot project.  This time we set it up again and it happened to work.  We were not able to diagnose what happened the first time, but we were relieved nonetheless.  After doing this, programming the man to eat the wombat was very simple, and got it working in a few minutes.  At the end of the day, we started the code for being able to make the man move using the arrow keys.  We had no idea how to do so, so instead we looked up some of the open source codes for games on greenfoot that gave us some very helpful tips.

No comments:

Post a Comment