Skip to content

Commit

Permalink
Merge pull request #82 from rowan04/play_test_branch_2
Browse files Browse the repository at this point in the history
added a ghost spawnpoint marker (a skull to show the ghosts are bound…
  • Loading branch information
Will-Cross1 authored May 2, 2023
2 parents 6b2aef9 + 743a17d commit be18da4
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
16 changes: 16 additions & 0 deletions maze-game/MyWorld.java
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@ private void addGhost1()
Ghost1 Ghost1 = new Ghost1();
addObject(Ghost1, x, y);
Ghost1.turn(Greenfoot.getRandomNumber(360));

//creating ghost spawnpoint marker for player
Skull skull1 = new Skull();
addObject(skull1, x, y);
}

/**
Expand All @@ -167,6 +171,10 @@ private void addGhost2()
Ghost2 Ghost2 = new Ghost2();
addObject(Ghost2, x, y);
Ghost2.turn(Greenfoot.getRandomNumber(360));

//creating ghost spawnpoint marker for player
Skull skull2 = new Skull();
addObject(skull2, x, y);
}

/**
Expand All @@ -188,6 +196,10 @@ private void addGhost3()
Ghost3 Ghost3 = new Ghost3();
addObject(Ghost3, x, y);
Ghost3.turn(Greenfoot.getRandomNumber(360));

//creating ghost spawnpoint marker for player
Skull skull3 = new Skull();
addObject(skull3, x, y);
}

/**
Expand All @@ -209,6 +221,10 @@ private void addGhost4()
Ghost4 Ghost4 = new Ghost4();
addObject(Ghost4, x, y);
Ghost4.turn(Greenfoot.getRandomNumber(360));

//creating ghost spawnpoint marker for player
Skull skull4 = new Skull();
addObject(skull4, x, y);
}

/**
Expand Down
25 changes: 25 additions & 0 deletions maze-game/Skull.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)

/**
* Write a description of class Skull here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Skull extends Actor
{
public Skull()
{
setImage("Skull.png");
GreenfootImage skull = getImage();
skull.scale(30, 30);
}
/**
* Act - do whatever the Skull wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
// Add your action code here.
}
}
Binary file added maze-game/images/Skull.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit be18da4

Please sign in to comment.