-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCARROT.java
47 lines (38 loc) · 979 Bytes
/
CARROT.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class BROCCOLI here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class CARROT extends PLANT
{
private GreenfootImage icon;
private GreenfootImage image;
public CARROT(){
super("blocks/plants/carrot/",5);
icon = new GreenfootImage("inventory/icons/carrot/carrot_icon.png");
image = icon;
}
public GreenfootImage get_icon(){
return icon;
}
public GreenfootImage get_image(){
return image;
}
public boolean is_stackable(){
return true;
}
public String get_name(){
return "carrot";
}
public int will_drop_item(TOOL tool){
if(tool.get_kind() == TOOLKIND.HOE){
return 1;
}
return -1;
}
public boolean is_placeable(){
return true;
}
}