ebmigue Posted September 4, 2011 Share Posted September 4, 2011 I know that this is a forgotten topic by now, and I apologise for reviving it. But it was only recently that I had free time and I just have this impulse to share an alternative implementation. Here goes: http://www.reetudes.com/samples/ctg-fight-game.php The unique character of this implementation is that it uses re (http://www.reetudes.com), a library that I started months ago (sorry if this seems like a plug ). Thus, its approach is relational -- minimal use of loops through the use of relational operators; players and player types are treated as data (not classes and objects), and hence the implementation could easily be revised to accommodate the possibility of additional players and player types, while still maintaining the basic "gist" of the game. Further, the current implementation uses regular PHP variables; but it could be easily replaced by db table references (w/c are conceptually variables) by using the facilities provided by re. Hence, the need to integrate it w/ existing DBMS becomes a less daunting task -- w/c is desirable if we want to persist a gamer's data, or provide a feature for end-users to edit and save the basic settings of the game (such as the abilities of player types). P.S.: I admit that performance is peculiarly bad when both player types are "brawlers". IMO, this has something to do w/ re's "un-optimised" form. I am optimistic though that things could still be improved. Thank you and hope it interests you. Quote Link to comment https://forums.phpfreaks.com/topic/239936-struggling-graduate/page/3/#findComment-1265286 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.