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

2021/11/6

Implement 3 timers for one world controlled from buttons

1
2
nafridi217 nafridi217

2021/11/7

#
danpost wrote...
nafridi217 wrote...
what code needs to go in the SimpleActor class? can you please provide that code?
danpost wrote...
A simple actor could have a complete class code as follows:
public class SimpleActor extends greenfoot.Actor {}
Is there any piece of code that needs to go in the {}? thank you
danpost danpost

2021/11/7

#
nafridi217 wrote...
Is there any piece of code that needs to go in the {}? thank you
No. That is what makes it a simple actor. You only use non-protected methods provided in the Actor class on instances of the class (getting and/or setting its image, location, rotation and world; and testing if at edge). It is useful for many object "types" without having to explicitly define them. I find it very useful for GUI type objects, which the timer display is; but, there are many other uses as well.
nafridi217 nafridi217

2021/11/7

#
Hey okay so I was able to display the timer but its showing in milliseconds, even though I am using the timer code that I sent you earlier. Can you provide code to display the timer in seconds and also in minutes? thank you for your help.
danpost danpost

2021/11/7

#
nafridi217 wrote...
Hey okay so I was able to display the timer but its showing in milliseconds, even though I am using the timer code that I sent you earlier. Can you provide code to display the timer in seconds and also in minutes? thank you for your help.
Please refer to my Value Display Tutorial scenario.
You need to login to post a reply.
1
2