-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathInvincibleFlash.java
More file actions
68 lines (54 loc) · 1.26 KB
/
InvincibleFlash.java
File metadata and controls
68 lines (54 loc) · 1.26 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
59
60
61
62
63
64
65
66
67
68
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 InvincibleFlash implements Runnable{
// Global Variables
public Monster monster;
public Link link;
public boolean forLink;
// public BufferedImage
//public JLabel theLabel = new JLabel("SAGFAD");
public InvincibleFlash(Link thePlayer) {
link = thePlayer;
forLink = true;
}
public InvincibleFlash(Monster theMonster) {
monster = theMonster;
forLink = false;
}
public void run(){
while (1>0){
if (this.forLink){
if (this.link.invincible && this.link.visible){
this.link.visible = false;
}
else {
this.link.visible = true;
}
//System.out.println(this.link.visible);
}
else {
if (this.monster.flash && this.monster.visible){
this.monster.visible = false;
}
else {
this.monster.visible = true;
}
}
try{
Thread.sleep(1); //Delay his next image change
}
catch (InterruptedException e){
}
}
}
}