-
Notifications
You must be signed in to change notification settings - Fork 5
/
RepeaterPacket.java
28 lines (25 loc) · 848 Bytes
/
RepeaterPacket.java
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
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class RepeaterPacket here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class RepeaterPacket extends SeedPacket
{
/**
* Act - do whatever the RepeaterPacket wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public RepeaterPacket() {
super(11000L, true, 225, "repeaterpacket");
}
public TransparentObject addImage() {
TransparentObject temp = new TransparentRepeater(false);
((MyWorld)getWorld()).addObject(temp, Greenfoot.getMouseInfo().getX(), Greenfoot.getMouseInfo().getY());
return temp;
}
public Plant getPlant() {
return new Repeater();
}
}