Wow, this is really neat, I hadn't thought of trying to code Conway's Game of Life in Greenfoot. As soon as I saw this, I immediately started playing with the spaceships! XD
Neat game! Oddly addictive, though you might want to add some sort of a score system or a counter. I did notice you had a counter class in the project, but you didn't seem to be using it. Still, it's a fun game!
When you create a constructor for a class, whenever you create a new class, you need to pass in the variable. Here's an example not in greenfoot:
public class myPrint
{
public myPrint(string whatToPrint) {
print(whatToPrint);
}
}
Then I'd do:
new myPrint("TestPrint")
and by passing in the string "TestPrint", the object myPrint would set its variable whatToPrint to "TestPrint"
It's sortof a difficult concept to grasp, I hope I explained it well.
Sure, I'll re-upload it with open source.
The way I did that though was with a constructor, the bullet class looks something like this:
public class Bullet extends Actor
{
public Bullet(int dir) {
setRotation(dir);
}
public void act()
{
move(5);
}
}
Then, when I create the bullet I do it like this:
getWorld().addObject(new Bullet(getRotation()), getX(), getY());
Thanks! Like I said though, it's not done yet. Also, I normally leave sound on my computer off, so sometimes I forget about it. I'll try to add sound to the next version, thanks for the feedback!
2013/11/10
Isometric
2013/11/8
Space Chase
2013/11/8
Ninto's Game of Life
2013/11/8
Collision Physics (Gravity) 1.2.3
2013/11/8
Collision Physics (Gravity) 1.2.3
2013/11/8
Asteroid Field Navigator 3000
2013/11/8
Ultimate Weapon
2013/11/8
Ultimate Weapon
2013/11/7
Ultimate Weapon