home *** CD-ROM | disk | FTP | other *** search
-
- Numbers Up
- ----------
-
- Version 1.2
-
- By
-
- Jason Lowe
-
-
- THIS PROGRAM IS PUBLIC DOMAIN. IT MAY BE DISTRIBUTED FREELY AND MAY APPEAR
- IN ANY PUBLIC DOMAIN LIBRARY ON THE CONDITION THAT THIS TEXT FILE REMAIN
- WITH THE EXECUTABLE.
-
- THIS PROGRAM USES ANDERS BJERINS INCLUDESOUND TO PLAY THE SOUND FOUND
- IN THIS PROGRAM. THANKS ANDERS.
-
- Preface:
-
- Completed: December, 1991
- Language: Aztec C v5.0a
- Programmer: Jason Lowe
- Age: 18
- Comments: Will have a bit of trouble compiling under Lattice! This
- program contains more documentation than NumberUp v1.0 which
- should help programmers interested in my source code! Also
- the space bar can be used instead of the left mouse button
- when playing Numbers Up.
-
-
- If you have any questions about me or my code, or want anything from me
- just write to,
-
- 5 Collaroy Close
- Chittaway Bay
- N.S.W 2259
- Australia.
-
- This text file contains the following information.
-
- i) Information on how to play NumbersUp.
- ii) Information to C programmers about my code.
-
-
-
-
- i) Information on how to play NumbersUp.
-
- When numbersup has loaded you will presented with a menu. Press the LMB
- to play numbers up. Press the RMB to view the high scores. Press I for
- information. Press Q to quit. While you are playing numbersup press the LMB
- or the space bar to shoot the numbers up.
-
- NumbersUp is a very simple game. The idea is to score as many points as
- you can. When you first start playing numbers up, numbers will fly in from
- both sides of the screen. You must shoot them up with your left mouse
- button ( LMB for short ) or the space bar. When you shoot a number up it will
- stop moving across the screen and start moving up until it hits either the
- line of asterixes or another number.
-
- Now how do you score? Very simply. When a number is placed to the right,
- to the left or below another number they are multiplied together and added
- to your score. BUT if two numbers the same are placed together the game
- will end. Also if you let a number fly past without shooting it up you will
- loose 100 points.
-
- The best ten scores will be saved to memory and if you request it will
- be saved to disk also. If there is no high score table present on the disk
- I will create a simple one consisting of ten scores of 100 points and the
- name "Jason" having scored all of them.
-
- You might have noticed that when you first start the game you will asked
- if you would like the high scores saved to disk. This is so you don't have
- to always save you high scores to disk, without the hassle of selecting
- cancel from the "Disk is write protected" requester.
-
-
-
-
- ii) Information to C programmers about my code.
-
- NumbersUp was written in Aztec C v5.0a by Jason Lowe. If there is only
- the main source code with this game ( numbersup.c ) and none of the include
- files and you would like to see the complete source code just write or
- if there is no source code at all with this program and you would like to
- see it. To compile and link this program there is only a few things you
- need to remember. Force the data into chip memory and also link the
- compiled code with Anders' Bjerins EASYPLAYER.
-
- With this program I have written the whole game as many functions. I
- then test each function as best I can and then when I am happy with a
- particular function I will proceed to write more functions. With NumbersUp
- I firstly got numbers running from both sides of the screen, then worked
- out how to shoot them up, etc.
-
- The functions I have used in NumbersUp are, (in no particular order)
-
- - ViewInstructions
- - ViewHighScores
- - ClearSelected
- - NumbersUp
- - CheckHighScores
- - InitHighScores
- - LoadHighScores
- - CreateBrandNew
- - CreateNew
- - InitRandom
- - Up
- - DisplayScore
- - InitScreen
- - InitLoc
- - idcmpch
- - Open_Stuff
- - die
-
- Now a small description of each of these functions,
-
- - ViewInstructions
- This draws a image into the rastport. It is drawn if the user presses
- the letter "I" at the main menu.
-
- - ViewHighScores
- This will display the current top ten highscores. This is activated
- if the user presses the right mouse button from the main menu. It is
- also activated if the user gets a high score.
-
- - ClearSelected
- This clears the rectangular area where all the numbers are drawn. It
- does no clear the main title "NumbersUp" and the surrounding border.
-
- - NumbersUp
- This is the main game NumbersUp. It is called when the user presses
- the left mouse button from the main menu.
-
- - CheckHighScores
- This checks to see if the user has got a high. If the user has it
- will change the high score list accordingly. It will also save the high
- scores to disk if the user has previously specified.
-
- - InitHighScores
- This will try to load the high score table from disk. If it is
- sucsessful the high scores used while the program is active will be those
- loaded from the disk. If it can't open a high score table it will create a
- brand new one consisting of all ten names being JASON and all having
- scored 100 points.
-
- - LoadHighScore
- This loads all the high scores from disk into memory. It uses a
- string array for the names loaded called names and for the scores it
- uses an integer array called scores.
-
- - CreateBrandNew
- This creates a brand new high score table consisting of ten names
- called JASON and ten scores of 100 points.
-
- - CreateNew
- This creates a new disk file of high scores if the user gets a high
- score AND the user wishes to save thier scores to disk.
-
- - InitRandom
- This reseeds the random number generator.
-
- - Up
- This sends a number up from a specific location on the screen. It is
- called from the function NumbersUp when the user presses the left mouse
- button and a number is moving across the screen.
-
- - DisplayScore
- This displays the current score. It is called from NumbersUp when the
- user has sent a number up, and thier score has changed.
-
- - InitScreen
- This draws the asterixes around the screen, so a border can specify
- where the number can go.
-
- - InitLoc
- This clears all data about what numbers are where. It clears the
- variable loc out such that the computer thinks there are no numbers on the
- screen.
-
- - idcmpch
- This checks the IDCMP. It returns 1 for a left mouse button press, or
- 2 for a right mouse button press, or the raw value for any key pressed on
- the key board.
-
- - Open_Stuff
- Opens the libraries needed, a screen, and a window.
-
- - die
- Frees everthing that needs freeing and also closes everything that
- needs closing.
-
-
- I hope all of this documentation helps you C programmers out there.
-
- In the mean time, happy programming and computing...
-
-
-
-
-