Shooting Gallery

What I wanted to do was to make a sort of shooting gallery type game. You are behind a barrier that you can’t pass. There are usually balls on the other side that you have to shoot in order to move onto the next level. there are 5 levels total

CaptureCapture3Capture4

Level 4 consists of balloons. If you miss the 3rd balloon, the 1st one spawns back.

 

Capture5

 

In Level 5, barrels are moving in a giant circle. Hit one, the next one spawns in. Overall there are 3 barrels

Capture6

After every level, a door spawns. Each door leads to the next world. You can’t go back to previous levels.

my code for killing the enemy and having a door appear

 

 

if(enemy != null)
{
//enemy.kill();
World world;
world = getWorld();
world.removeObject(enemy);
world.removeObject(this);
Door d = new Door();
world.addObject(d,50,350);
}

Capture2

I would say that the hardest part of my program was probably getting the door to take me to another world.  I have to make it so that the door opens and then will take the character to the next level when they touch.

my code for where the door takes you.

public void checkdoor()
{
Actor d = (Door) getOneIntersectingObject(Door.class);

if(d != null)
{
if (d.getY() == 350)
{
Greenfoot.setWorld(new World2());
}
if (d.getY() == 380)
{
Greenfoot.setWorld(new World3());
}
if (d.getY() == 340)
{
Greenfoot.setWorld(new World4());

}
if (d.getY() == 330)
{
Greenfoot.setWorld(new World5());

}
}
}

 

My game may not be the hardest game that ever existed, but you can play it for hours and hours because after you beat the final level, a door appears that brings you back to the 2nd level. The 1st level is too easy to repeat again.

Leave a Reply

Your email address will not be published. Required fields are marked *