How would I go about the process of making a timer that begins at the press of a button?
Kinda new to this so any help is appreciated.
A Little Help?
VarrienceLvl 25
- Edited
depends, easiest way is a sprite and checking if the mouse button is pressed over the sprite, if were talking about custom collisions it could get a bit more complicated and we would also have a variable to keep track on what screen it was on
Varrience Yes but what do I use to keep time? variables that update in the draw function are too fast and the world seconds cant reset...
VarrienceLvl 25
- Edited
Date usually works pretty well if you want a solid formatted date if you want the time in seconds it's Date.now() but you'll have to do the parsing on your own to your liking should help you get kickstarted on some stuff you can do with it.
Also note that Date is not a block! to solve your other issue you should have local placeholders of an empty datatype that way the program will be automatically be able to tolerate any value that takes time
EX: var time = new Date();
console.log(time.now());
FluffypoopoLvl 55
Hey Varrience thx for filling my spot while I was gone
FluffypoopoLvl 55
App lab or Game lab?