chmpdog Posted July 14, 2009 Share Posted July 14, 2009 Hi, I am making a php game, but I cant figure out how to calculate the score. I have variables for total time, and levels. Also, if possible, I would like a bonus for certain things. How can I acomplish this? Do you know any resources (or perhaps the answer )? Quote Link to comment https://forums.phpfreaks.com/topic/165983-php-game-caculating-score/ Share on other sites More sharing options...
Daniel0 Posted July 14, 2009 Share Posted July 14, 2009 function score($level) { if ($level == 0) return 0; if ($level == 1) return 1; return score($level - 2) + score($level - 1); } Quote Link to comment https://forums.phpfreaks.com/topic/165983-php-game-caculating-score/#findComment-875444 Share on other sites More sharing options...
MadTechie Posted July 14, 2009 Share Posted July 14, 2009 Maybe workout how your going to work the scores first then come back write it. if you don't know how to do the logic manually you have no hope writing a the logic! Quote Link to comment https://forums.phpfreaks.com/topic/165983-php-game-caculating-score/#findComment-875448 Share on other sites More sharing options...
Daniel0 Posted July 14, 2009 Share Posted July 14, 2009 What's wrong with my Fibonacci scoring system? Quote Link to comment https://forums.phpfreaks.com/topic/165983-php-game-caculating-score/#findComment-875449 Share on other sites More sharing options...
.josh Posted July 14, 2009 Share Posted July 14, 2009 For one thing, Fibonacci sounds dirty. Quote Link to comment https://forums.phpfreaks.com/topic/165983-php-game-caculating-score/#findComment-875458 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.