-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathShamrock.java
More file actions
31 lines (29 loc) · 850 Bytes
/
Copy pathShamrock.java
File metadata and controls
31 lines (29 loc) · 850 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class Shamrock here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Shamrock extends Mushroom
{
/**
* Act - do whatever the Shamrock wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
super.act();
// Add your action code here.
}
protected void removeSelfIfTooSmall() {
if(getImage().getHeight() == 8){
for (int i=0; i < 12; i++) {
Laser l = new Laser(30*i);
l.getImage().scale(20, 20);
getWorld().addObject(l, getX(), getY());
}
getWorld().removeObject(this);
}
}
}