Friday, June 17, 2011

We Are Done!!!

After weeks of programming and editing codes, I have finally finished the checkers game! At the end the problem was a small inequality symbol.  It was very relieving to see it work after all our hard work. 
Here is the link to our checkers game:

http://greenfootgallery.org/scenarios/3174

Enjoy! Have a great summer!

Wednesday, May 18, 2011

5/18/11 - Connections with the community

Today, while Safath worked on the coding for gravity, which I did not lobby for, I was able to get connected to the Greenfoot community.  It was simply a forum group on greenfoot.com.  I created an account for us, so we can recieve help whenever we needed it.  This was a big step forward because it would help us find easier ways of solving problems. 
I did not like Safath's gravity project because I felt like that was too far ahead for where we were.  We still had a lot of other bugs to work out, and it seemed like gravity was the least of our worries at the moment.  But, I decided to let him do what he was doing while I got in touch with the greenfoot community. 

Monday, May 16, 2011

5/16/11 - One problem solved!

Today, we had a very productive day.  After last week, we were encountering problems on movement.  The problem was that if we tried to turn right, we could, but if we tried to turn left, we were just rotating.  But, we were able to solve the problem!  It was a simple code fix that involved getLocations for the x and y coordinates.  In conclusion the movement problem is solved!

Thursday, May 12, 2011

5/12/11 - Random Success

Today I came to class, but Safath was not here because he was sick.  I decided to look at his blog and see what he was able to do yesterday because I was not there.  He posted about not having success with the movement class despite various efforts and codes.  But, some person that we do not know commented on his blog post giving us exactly what we needed!!  This was so exciting because the link the person gave had so many methods that will all be helpful in the future.  I decided to go back to the source codes of the games from tuesday, and see if this code was present, and there it was!  The code for the movement is this simple void class:
public void act()
{
   
if (Greenfoot.isKeyDown("left")) {
        turn(-7);
    }
   
if (Greenfoot.isKeyDown("right")) {
        turn(7);
    }
    move();
   
if (canSee(Worm.class)) {
        eat(Worm.
class);
    }
}

I decided to implement this with Safath because his code for the wombat was more advanced and sophisticated...Stay Tuned!

Tuesday, May 10, 2011

5/10/11 - Movement Problems

Today, we tried to make things move in greenfoot using the arrow keys.  Most of the games on greenfoot have this function working very well and easily. First we started playing around inside the wombat class. If we call the turnleft() or move() in the void act(), we can make the wombat move around all over the place. We also thought about moving it to random spots using the random class, which is under one of the tutorial exercises on the website.  I got the source code from some games on greenfoot.  But, their code is so confusing and long, and it is hard to find which part of it is the code for the movement.  Every time we found some sort of code, it did not work because it needed some other code that was called from somewhere else.  Needless to say, it was very frustrating...  Hopefully we can get it to work tomorrow. 

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.

5/6/11 - Tutorial and Problems with Greenfoot :(

Today I started out by looking at some tutorials on greenfoot.org. The video tutorials were not working because they needed a tutorial, so I looked up the written tutorial, here.  I only read some of the intro stuff, but I wanted to see how to manipulate the wombat class first.  But, unfortunately to do so, they wanted the user to learn about the scenarios and how it affects the program.  After reading that, which was somewhat informative, I got to the programming of the greenfoot.  I read some of the material and it seemed pretty simple because most of the program is already written and you needed to do is to change certain parts of the class.  Once I knew how to manipulate the wombat class, I opened greenfoot.  I tried to change the wombat but I was unable to save and compile the wombat.  This was because of the ubuntu, and their system thought we were trying to hack and save the wombat class to the greenfoot system.  We will have to wait until Stavros fixes it on Monday.