One Of Halls Game Timer

Place for questions and answers for all newcomers and new coders. This is a free for all forum, no question is too stupid and to noob.
Post Reply
User avatar
Epiales
Posts: 1119
Joined: Thu Aug 15, 2013 1:38 am

One Of Halls Game Timer

Post 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!
Nothing fancy, but a work in progress!

http://gameplaytoday.net
Sim
Posts: 412
Joined: Sat Dec 26, 2009 5:37 pm

Re: One Of Halls Game Timer

Post 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/
oRPG Creator - Make Your Own Browser Game
oRPG Creator on Facebook
User avatar
MikuzA
Posts: 395
Joined: Thu Aug 08, 2013 8:57 am

Re: One Of Halls Game Timer

Post 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.
Why so serious?

Business Intelligence, Data Engineering, Data Mining
PHP, HTML, JavaScript, Bash/KornShell, Python, C#, PL/SQL
MySQL, DB2, Oracle, Snowflake
Pentaho, DataStage, Matillion, Unity3D, Blender
User avatar
hallsofvallhalla
Site Admin
Posts: 12031
Joined: Wed Apr 22, 2009 11:29 pm

Re: One Of Halls Game Timer

Post 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.
User avatar
Epiales
Posts: 1119
Joined: Thu Aug 15, 2013 1:38 am

Re: One Of Halls Game Timer

Post 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.
Nothing fancy, but a work in progress!

http://gameplaytoday.net
Post Reply

Return to “Beginner Help and Support”