-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBlood.java
More file actions
28 lines (27 loc) · 995 Bytes
/
Blood.java
File metadata and controls
28 lines (27 loc) · 995 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
28
import greenfoot.*;
/**
* Write a description of class Blood here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Blood extends Effects
{
SimpleTimer timer = new SimpleTimer();
/**
* Act - do whatever the Blood wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
if(timer.millisElapsed() > 0)setImage("blood1.png");
if(timer.millisElapsed() > 50)setImage("blood2.png");
if(timer.millisElapsed() > 100)setImage("blood3.png");
if(timer.millisElapsed() > 150)setImage("blood4.png");
if(timer.millisElapsed() > 200)setImage("blood5.png");
if(timer.millisElapsed() > 250)setImage("blood6.png");
if(timer.millisElapsed() > 300)setImage("blood7.png");
if(timer.millisElapsed() > 350)setImage("blood8.png");
if(timer.millisElapsed() > 350)getWorld().removeObject(this);
}
}