-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathArrow.java
More file actions
58 lines (46 loc) · 1.11 KB
/
Arrow.java
File metadata and controls
58 lines (46 loc) · 1.11 KB
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
import java.awt.*;
import javax.swing.*;
import java.awt.image.*;
import java.awt.image.*;
import java.io.*;
import javax.imageio.*;
import java.awt.event.*;
import java.util.*;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import javax.imageio.ImageIO;
//import json.org.*;
public class Arrow extends Projectile{
// Global Variables
//public JLabel theLabel = new JLabel("SAGFAD");
public Arrow(Monster theMonster) {
super(theMonster);
for (int i = 0; i < 4; i++){
try{
this.cache[i] = ImageIO.read(new File("mis sprites/" + (i + 1) + ".gif")); //Saves each of Link's pictures for easy access
//this.linkPic[i].setOpaque(false);
}
catch (IOException e){
}
}
this.speed = 5;
this.strength = 2;
this.blockable = true;
}
public void run(){
while (1>0){
if (this.visible){
this.move();
this.linkHit();
}
if (checkBounds()){
this.visible = false;
}
try{
Thread.sleep(this.speed); //Delay his next image change
}
catch (InterruptedException e){
}
}
}
}