Score und neue Platforms sowie Player Figur
This commit is contained in:
+1
-10
@@ -8,22 +8,13 @@ import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
|
||||
*/
|
||||
public class Score extends Actor
|
||||
{
|
||||
int timer;
|
||||
|
||||
/**
|
||||
* Act - do whatever the UI wants to do. This method is called whenever
|
||||
* the 'Act' or 'Run' button gets pressed in the environment.
|
||||
*/
|
||||
public void act()
|
||||
{
|
||||
timer++;
|
||||
draw_score();
|
||||
}
|
||||
|
||||
public void draw_score(){
|
||||
setImage(new GreenfootImage("Score:" + calculate_score(), 24, Color.WHITE, Color.BLACK));
|
||||
}
|
||||
|
||||
public int calculate_score(){
|
||||
return timer/60;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user