-
Notifications
You must be signed in to change notification settings - Fork 0
/
Cindy.java
61 lines (52 loc) · 2.05 KB
/
Cindy.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Cindy is a resident of MainWorld.
*
* @author Anthony Neeser
* @version 4/30/18
*/
public class Cindy extends Villager
{
//Set image change delay to pass to FriendlyNPC.
private int imgChangeDelay = 15;
//Set step delay (Higher means a slower walk speed in world).
private int stepDelay = 2;
//Set direction change delay
private int dirSwitch = 200;
//Set range in which NPC notices main character
private int mcRange = 200;
//Shadow specifications
private int shadowImageWidth = 64;
private int shadowImageHeight = 128;
private int shadowX = 17;
private int shadowY = 82;
private int shadowWidth = 35;
private int shadowHeight = 20;
//Set if enemy will shoot, what ammo to use, speed of the ammo, and how often to reload.
private String classType = "archer"; //"archer", "spearman", "melee"
private String projectile = "arrow"; // "arrow", "spear"
private int projectileWidth = 18;
private int projectileHeight = 7;
private int shotSpeed = 10;
private int removalCount = 25;
private int reloadDelay = Greenfoot.getRandomNumber(100)+100; //Adds delay to reload so that each enemy is different.
//Angry?
public boolean angry = false;
/**
* Cindy constructor. Sets initial image.
*/
public Cindy()
{
setImage("char/JenniferAniston/JenniferAniston_Front.png");
}
/**
* Act - do whatever the Villager wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
variablePass("char/JenniferAniston/JenniferAniston_", imgChangeDelay, shadowImageWidth, shadowImageHeight, shadowX, shadowY, shadowWidth, shadowHeight,
stepDelay, dirSwitch, mcRange, angry, classType, projectile, projectileWidth, projectileHeight, shotSpeed, removalCount, reloadDelay);
genericDialog("health");
}
}