🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Mixing PHP and Javascript for Base building type RTS games

Started by
3 comments, last by felix.speagel 2 years, 1 month ago

I am interesting in making a simple browser RTS game - the type that has timers on buildings and mats. So my main question is how can javascript timer and vars be mixed with PHP?

I am aware of the serverside (php) and client side (JS), so if these games do not use javascript, what other methods are used to create a live timer and then show results?

Thanks!!!!

Advertisement

This is not a Writing question. Moving to a more appropriate forum.

-- Tom Sloper -- sloperama.com

thanks - sorry.

Well, one simple method which comes into my head is: when a player makes some decision which launches some action that requires some time to finish, it is best to mark its time of completion on the server side. Then, I think, your JS could just store that time and show to the player a timer.

Although, it is simple what I wrote here, I have to emphasize one thing: time of completion MUST be stored on your server. I have seen some games like the one you described (my dad once played one of such a game), and I saw that many players search for some “hack” to speed up their building process in a game. If, for example, you would chose to place all that time counting system in JS then a savvy player may simply ignore your JS program and write his own and then use it to force your server-side program to finish building something before time.

None

This topic is closed to new replies.

Advertisement