This site requires JavaScript, please enable it in your browser!
Greenfoot back
liverpoolfc
liverpoolfc wrote ...

2019/7/24

h timer

liverpoolfc liverpoolfc

2019/7/24

#
how to make timer such that every time it reaches a new level, the timer resets??
danpost danpost

2019/7/24

#
liverpoolfc wrote...
how to make timer such that every time it reaches a new level, the timer resets??
A far as displaying a timer value, my tutorial has information about that both in A Basic Actor Object and in Building a Counter Actor Object. Specifics, however, really depends on what kind of timer you need (how it behaves and what is is to display). A far as resetting for levels, you should know by now that what codes you are using will make a difference in how to proceed. Cannot offer advice when we do not know much about what you currently have (specifically, how levels are set up and what you already have as far as the timer; probably meaning your World subclass, your Timer class, or the Actor or class used to display the value, and maybe others).
liverpoolfc liverpoolfc

2019/7/24

#
I dont have a timer class.
Proprogrammer04 Proprogrammer04

2019/8/2

#
You could implemet this in your world class:
int timer
public void act()
{
    timer++;
    //shows the timer:
    getWorld().showText(„“+timer,100,50);
}
You have to paste that under the
public world() 
//instead of world, it‘s named 
//like your world-class
{
    //this alteady exists in your editor
}
You need to login to post a reply.