Page 1 of 1

One Of Halls Game Timer

Posted: Sun Oct 19, 2014 12:14 am
by Epiales
I don't remember what game it was, but on one game you were creating, there was a boost where you could click the button and the timer would start counting down. This was done in PHP, and even since my last game I was working on, I was trying to figure out how to do that but never did. I wonder if you could share that code please? Thx!

Re: One Of Halls Game Timer

Posted: Sun Oct 19, 2014 2:11 am
by Sim
Epiales wrote:I don't remember what game it was, but on one game you were creating, there was a boost where you could click the button and the timer would start counting down. This was done in PHP, and even since my last game I was working on, I was trying to figure out how to do that but never did. I wonder if you could share that code please? Thx!
PHP cant do that. Try this is a start:
https://blog.smalldo.gs/2013/12/create- ... countdown/

Re: One Of Halls Game Timer

Posted: Sun Oct 19, 2014 7:24 pm
by MikuzA
PHP can do a timer, but not a visible one (that you see counting down).
Have a button that enables timer,
when clicked initiate a php insert/update to a table with the current timestamp.
Use Javascript countdown to visualise the time left.

When page is refreshed, retrieve the timestamp from database and visualize the countdown with js.

To make it 'safe', add a AJAX for the js to retrieve a confirmation from db when the countdown is 0.
Then enable the button. Otherwise refresh the countdown.

Re: One Of Halls Game Timer

Posted: Wed Oct 22, 2014 3:42 pm
by hallsofvallhalla
hmm dont remember what it was from but I believe I used JS for the actual display and then used PHP for the updating and actual timer as stated above.

Re: One Of Halls Game Timer

Posted: Fri Oct 24, 2014 4:07 am
by Epiales
hallsofvallhalla wrote:hmm dont remember what it was from but I believe I used JS for the actual display and then used PHP for the updating and actual timer as stated above.
Yeah, it might have been urban realms. I watched what videos you had on there, but it didn't cover the timer. So was just curious if you had it lying around.

Re: One Of Halls Game Timer

Posted: Mon Oct 27, 2014 6:14 pm
by hallsofvallhalla