Click to add title

Having Fun with Your
Feet…better yet, Greenfoot
TM
Nicolas Romero
February 28, 2009
Gaming Academy
CTD – SEP
Northwestern University
What I learned and taught my dad
Java™ is not a type of
coffee you order at
Starbucks…..
Gracias!
Mr. Myers for making
class fun.
How I Designed My Game
1. Selected Spacewar Scenario
2. Changed space ship design
3. Added enemy/space ship disappearance
4. Added explosion sound/visual
5. Added score
Selected Spacewar Scenario
Nice rocket
ship…but not
a lot of
ACTION!
Let’s start by
changing the
ship.
Changed space ship design
turned into
I changed the space ship design by
selecting “set image” for the space ship
“actor” and choosing another picture.
Added enemy/space ship disappearance
It’s NO fun if you shoot the enemy and it
doesn’t disappear……
I modified the scenario by adding the following
code:
getWorld().removeObject(this);
}
else if(getOneIntersectingObject(Laser.class) != null)
{getWorld().addObject(new Explosion(), getX(), getY());
getWorld().removeObject(this);
Added explosion sound/visual
A video game without sound!!
Who ever heard of that? I wanted to hear
and see the explosion so I added the
following code.
else if(getOneIntersectingObject(Laser.class) != null)
{
count++;
scoreNum.setText("Score: " + count);
getWorld().addObject(new Explosion(), getX(), getY());
resurrect();
//getWorld().removeObject(this);
Greenfoot.playSound("explosion.wav");
Added score
Finally, I loved blowing up enemy ships but I also
wanted to keep track of how many so I added
more code.
IF YOU MISS Then it’s -1
if (getX() <= 0)
{ setLocation(getWorld().getWidth() + 20 , Greenfoot.getRandomNumber(600));
count--;
scoreNum.setText("Score: " + count);
}
IF YOU HIT!!! Then it’s +1
else if(getOneIntersectingObject(Laser.class) != null)
{
count++;
scoreNum.setText("Score: " + count);
El Fin!
And now for the
demo……