-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #66 from rowan04/create_ghost_buster_gun
added a gun and made the treasure dropped by the ghost
- Loading branch information
Showing
19 changed files
with
334 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) | ||
|
||
/** | ||
* Write a description of class Beam here. | ||
* | ||
* @author (your name) | ||
* @version (a version number or a date) | ||
*/ | ||
public class Beam extends Actor | ||
{ | ||
private int direction, speed; | ||
|
||
public Beam(int dir) | ||
{ | ||
GreenfootImage beam = getImage(); | ||
beam.scale(15, 15); | ||
|
||
direction = dir; | ||
speed = 15; | ||
} | ||
/** | ||
* Act - do whatever the Beam wants to do. This method is called whenever | ||
* the 'Act' or 'Run' button gets pressed in the environment. | ||
*/ | ||
public void act() | ||
{ | ||
setRotation(direction); | ||
move(speed); | ||
if (isTouching(Wall1.class)) | ||
{ | ||
getWorld().removeObject(this); | ||
} | ||
else if (isAtEdge()) | ||
{ | ||
getWorld().removeObject(this); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) | ||
|
||
/** | ||
* Write a description of class ghost_buster_icon here. | ||
* | ||
* @author (your name) | ||
* @version (a version number or a date) | ||
*/ | ||
public class Ghost_buster_icon extends Actor | ||
{ | ||
public Ghost_buster_icon() //constructor to resize ghost_buster_icon to be a better fit for the inventory | ||
{ | ||
GreenfootImage zap = getImage(); | ||
zap.scale(100, 100); | ||
} | ||
/** | ||
* Act - do whatever the ghost_buster_icon 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. | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,5 +13,6 @@ public class Wall1 extends Actor | |
|
||
public void act() | ||
{ | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) | ||
|
||
/** | ||
* Write a description of class Zapper here. | ||
* | ||
* @author (your name) | ||
* @version (a version number or a date) | ||
*/ | ||
public class Zapper extends Actor | ||
{ | ||
public Zapper() //constructor to resize Teleport icon to be a better fit for the maze | ||
{ | ||
GreenfootImage zap = getImage(); | ||
zap.scale(50, 50); | ||
} | ||
/** | ||
* Act - do whatever the Zapper 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. | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.