-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0763574
commit f2bca8f
Showing
8 changed files
with
276 additions
and
219 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#BlueJ class context | ||
comment0.target=finishedSending | ||
comment0.text=\r\n\ Write\ a\ description\ of\ class\ Timer2\ here.\r\n\ \r\n\ @author\ (your\ name)\ \r\n\ @version\ (a\ version\ number\ or\ a\ date)\r\n | ||
comment1.params=level\ delayTime | ||
comment1.target=finishedSending(WaveManager,\ long) | ||
comment2.params= | ||
comment2.target=void\ act() | ||
numComments=3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
|
||
import greenfoot.*; | ||
|
||
/** | ||
* Write a description of class Timer2 here. | ||
* | ||
* @author (your name) | ||
* @version (a version number or a date) | ||
*/ | ||
class finishedSending extends Actor | ||
{ | ||
public long deltaTime; | ||
public long lastFrame = System.nanoTime(); | ||
public long currentFrame = System.nanoTime(); | ||
public long delayTime; | ||
|
||
public WaveManager level; | ||
|
||
finishedSending(WaveManager level, long delayTime) { | ||
this.delayTime = delayTime; | ||
|
||
|
||
this.level = level; | ||
} | ||
public void act() { | ||
currentFrame = System.nanoTime(); | ||
deltaTime = (currentFrame - lastFrame) / 1000000; | ||
if (deltaTime > delayTime) { | ||
|
||
level.finishedSending = true; | ||
getWorld().removeObject(this); | ||
return; | ||
} | ||
|
||
|
||
} | ||
} |
Oops, something went wrong.