-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathSunflowerPacket.java
More file actions
27 lines (25 loc) · 840 Bytes
/
Copy pathSunflowerPacket.java
File metadata and controls
27 lines (25 loc) · 840 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
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class SunflowerPacket here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class SunflowerPacket extends SeedPacket
{
/**
* Act - do whatever the SunflowerPacket wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public SunflowerPacket() {
super(8000L, true,50, "sunflowerpacket");
}
public TransparentObject addImage() {
TransparentObject temp = new TransparentSunflower(false);
((MyWorld)getWorld()).addObject(temp, Greenfoot.getMouseInfo().getX(), Greenfoot.getMouseInfo().getY());
return temp;
}
public Plant getPlant() {
return new Sunflower();
}
}