PHP Tutorial: Number Guessing Game (no database required)


Originally posted on Online Game Development:

Wow I guess it’s been a while since I’ve posted anything. I’ve been busy moving and working on my games but I did find a few minutes to make this little game. This randomly picks a number and then lets the player try to guess the number. If you like this game you might also like my Ajax Tic-Tac-Toe game or Ajax Hangman game. This assumes that you’ve already done some of my other game tutorials so you are familiar with my game manager and how it works. You can read the code below or you can be lazy and can download the code or view a working example.

<?php /*** * File: oop/class.guessnumber.php * Author: design1online.com, LLC * Created: 8.21.2014 * License: Public GNU ***/ class guessnumber extends game {     var $guesses;              //int - maximum guesses per game     var $randomNumber = null; …

View original 864 more words