akrin03 Posted January 11, 2008 Share Posted January 11, 2008 Hello I'm in the process of developing a web-based, massive multiplayer strategy game. What I'm having a problem is: * User clicks on building X to purchase, which would have a timer of 20-minutes that should countdown until 0 then add this building to users buildings .. Would something like this be possible without the use of cron (which my host doesn't support) Suggestions would be GREATLY appreciated Thanks in advanced Quote Link to comment https://forums.phpfreaks.com/topic/85607-solved-countdown-timer/ Share on other sites More sharing options...
p2grace Posted January 11, 2008 Share Posted January 11, 2008 Are you using ajax to develop the game? If you're not, you might want to consider it. If you are, use a simple setTimeout with javascript to call an ajax function. Quote Link to comment https://forums.phpfreaks.com/topic/85607-solved-countdown-timer/#findComment-436894 Share on other sites More sharing options...
mssever Posted January 12, 2008 Share Posted January 12, 2008 You could also store the time the building will be completed somewhere and then on every page load check the status of to-be-completed items. Quote Link to comment https://forums.phpfreaks.com/topic/85607-solved-countdown-timer/#findComment-436925 Share on other sites More sharing options...
revraz Posted January 12, 2008 Share Posted January 12, 2008 Java would be the easiest. Quote Link to comment https://forums.phpfreaks.com/topic/85607-solved-countdown-timer/#findComment-436933 Share on other sites More sharing options...
akrin03 Posted January 15, 2008 Author Share Posted January 15, 2008 What is ajax .. I know that sounds dumb but heck if this program or whatever helps make the development of this game easier then It'll be worth it .. and the program (or whatever this is) free? A simple countdown timer using a javascript would be easier, a check of the players funds would be first then if the player has the funds to purchase the building then if everythings OK, the countdown timer would run until it reaches 00:00 then the purchase would be complete... This is what we're looking for, or download (or purchase ajax) and use this ... Thanks again Quote Link to comment https://forums.phpfreaks.com/topic/85607-solved-countdown-timer/#findComment-440301 Share on other sites More sharing options...
p2grace Posted January 15, 2008 Share Posted January 15, 2008 Basically ajax bridges the gap between php and javascript. I use xajax at http://xajaxproject.org/. It's completely free. Quote Link to comment https://forums.phpfreaks.com/topic/85607-solved-countdown-timer/#findComment-440308 Share on other sites More sharing options...
akrin03 Posted January 16, 2008 Author Share Posted January 16, 2008 Ah sounds grreat. Currently I'm using basic HTML and php/sql for the creation of our game. The countdown timer we're looking for would be a great feature, each purchase that the user would make would have a counter attached to it .. even the upgrades would have a counter attached to it. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/85607-solved-countdown-timer/#findComment-440858 Share on other sites More sharing options...
nikefido Posted January 16, 2008 Share Posted January 16, 2008 not to say that it cant be done with php/mysql/html, but i would def suggest using flash/actionscript There's healthy support out there for Flash game developers, and I think it would give you greater freedoms for such an application. Anyway, that's my (probably unhelpful) 2 cents. Quote Link to comment https://forums.phpfreaks.com/topic/85607-solved-countdown-timer/#findComment-440895 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.