Friday, June 17, 2011

Checkers Finished

After weeks of critical thinking, editing and analyzing our code, we have finally finished our multiplayer checkers game. The problem that we had before with the pieces wanting to move up only was fixed after we changed an inequality  symbol. The solution was simple but took forever to find.

The link below is our finished product.

Monday, June 13, 2011

Further Checkers Problem

Okay so we have everything done except  that both checker pieces want to go up, not down. For example, red goes up but white does not go down. Everything else works.

Friday, June 10, 2011

Checkers Problem

Getting the algorithm for taking over a piece is a little confusing. We know how to set up turns using a boolean but the restricting movement and jumping over killing is different from what we know how to do, which is to remove something when it makes contact with another object or after a certain time. Id be easier to just shoot the pieces.  

Monday, June 6, 2011

Checkers

Today we decided on our final project, checkers. We started out by making a 8x8 grid and then changing the colors. We then made a subclass of pieces, and then a black and red piece. We set them up in the right positions and then started to write the booleans for taking turns. We are thinking of modifying the foundleaf boolean for checkers piece found to jump.

Monday, May 30, 2011

Mouse and Shooting

Mouse:
To get information on a mouse click, you use Greenfoot.getMouseInfo(). Now if you store this in a int, you can do all sorts of things. For instance, you can get the mouse x and y coordinates of where you clicked or last click. You can also make things follow the mouse. Using move() along with mouseinfo, you can use your mouse to move instead of using arrow keys which he had previously used.


Shooting:
Shooting is very simple. Basically all you do is make an object appear on the grid and make it move. To make it seem like its shooting from a certain object, you just need to get the location of that object and create the object there or near it, and then make it move using the move(//put a double here). The move() will have to be inside the class thats supposed to be the bullet or whatever you're shooting. To make it disappear, you just have to use .removeobject(). You can also then place a new image of where the object disappeared to make it seem like you shot something.


Working on:
We need to create an enemy that we can shoot down. What I currently don't understand is how to do contact with one class with another. We think that we can simply modify the eatleaf thing that was given to us in the wombat class in order to achieve this goal. Shyam thought that we should create a frogger game. I don't know what that is, so I will have to play a few before I know what he's talking about.


This week will be SOL week for us in school. That means that we will have SOL's in the morning and then classes in the afternoon. Therefore, we will not be able to make it to the career center the entire week. However, we will continue to work on it at home.

Monday, May 23, 2011

Need Game Idea

Using Greenfoot, I want to create a game to try out some of the things I've learned so far, such as movement, "eating", solid objects. The problem is, many of these games have been made already, so we are not sure what to make, we'd just be copying or rewriting the code. One thing I thought would be fun, is to recreate one of the games on the greenfoot website that does not share the source code. The games, however, are very complex, but share many of the same ideas that we have already learned. Any ideas what what I should create or would you like to see just a whole bunch of stuff compresesd into one scenario? Post below please.

They have these video tutorials on the website, (I did not notice until recently) which I will be going through and trying out at home starting this week since I am unable to watch them in school. This should save us A LOT of time because before this, I was reading other peoples codes and learning that way. Please be patient with me, if I watch some of these videos, I am sure I can make a fun game - atleast for myself.

Thursday, May 19, 2011

Gravity and forums

I've moved all the movement keys into one subclass under actor, so now i can make as many moving icons as i like using this one subclass. Once gravity is implemented, the icon goes all the way down, halfway off the grid. I copied gravity from someone else, so I am having difficulties controlling it. Once I play around with it, I should have a better understanding. I can create solid objects and make them move as well. The problem now is that of gravity. I also want to create a world, not keep the current grid we have or have a one color world.

Shyam and I have signed up on the greenfoot forums under the user name "gctaastudents". Unfortunately they do not have a live irc chat or anything like that but they posted on their forum that they will try their best to attend to everyone's questions.

Monday, May 16, 2011

Movement Problem SOLVED

On Friday I was looking at many different codes and I got way too confused. Today I was very discouraged but Mr. Spanos encouraged me and found something very neat. Basically all you have to do in order to move is change the x and y coordinates, like add or subtract from the current x,y values.  All you do is use this code : setLocation(getX(), getY()) and you can + or - after "getX". Now i can freely move around on my grid.

Friday, May 13, 2011

Movement Problems

My post apparently got deleted somehow so I am going to repost what's been deleted.



For the past two days, we have been trying to make things move in greenfoot. 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, which is under one of the tutorial exercises on the website.

What we really want to do is move around with arrow keys. What I did today was get the source code of a couple of game on the site. Then I opened it up on greenfoot and tried to understand some of the code. I will stay after school tomorrow and try to figure out how to move with arrow keys. I think movement is crucial right now before we move on to other things.

Tuesday, May 10, 2011

First Actor subclass



First off, from last week, our system admin and Mr. Elkner has taught us a very important lesson when it comes to problem solving, the analogy RTFM. Basically, all we had to do to create,edit and play around in greenfoot was to “save a copy as” of the given greenfoot classes in a folder on your own computer.

After playing around with what was given to us, the wombat and leaf actors, we decided to create our own actor, Man. Studying the wombat subclass, we were able to edit it and make the man eat the wombat, much like the wombat eats the leaves. Then we stationed the man at some points on the grid, and as the wombat travels around and runs into the man, it will be eaten. One thing that we learned doing this is that if you put multiple wombats on top of each other on the same grid location and run them (act()), once they both run into the man class, one of the wombats will escape while the other is eaten. We also put a leaf and man on the same grid location and once the wombat reaches that location, the man eats the wombat before the wombat eats the leaf. However, if there are many wombats stacked that go over the man class, one of the wombats will actually eat the leaf and escape without getting eaten.

 Before:

 After:

Friday, May 6, 2011

Greenfoot Firstlook

Greenfoot is very similar to gridworld in how it looks and how its written. However, it's more general in the fact that one subclass is not limited to only one act; this allows us to play around. Therefore, greenfoot is perfect for making games as seen in the massive gallery on their website.


Currently, we are on the read-only version of greenfoot. Here, we have two types of classes, the world classes and the actor classes. A subclass of actor is Wombat, which goes to the closest leaf (which is another subclass of actor), eats the leaf and then travels around the edge of the bounded grid (default 8x8) forever, eating any leaves that might be in its path.

We are waiting for a system admin to come and install greenfoot and save it in a way that we will be able to edit and save classes.

Looking at the gallery, I think we will have a ton of fun using greenfoot because we love to play games. We are very excited and hope that we can get started on this asap.