|
Pong for graphics calculator
(Note: this version is written for the CASIO fx-9750G calculator, although it should work on later CASIO models too.)
(Second note: if you think this should belong in the 'stupidity' section, you are an Unkind Person. Go and and feel guilty for an unspecified length of time.)
Installation instructions
Read your manual as to how to set up programs first. You'll need to type in three programs to run Pong; the main program and two sub-programs which Pong calls for certain functions. Type the programs in exactly as shown, using the given names (to enter a return in the program, press EXE). Then select the 'Pong' program and press F1(EXE) to run it. The controls (hold the keys down, don't just tap them) are:
- LEFT - move left
- RIGHT - move right
- cos - 'turbo' left (uses up one nitro-credit, number remaining shown top left)
- tan - 'turbo' right (uses up one nitro-credit)
- 4 - Pause (because its alphabet character is 'P')
- 1 - Unpause (ditto 'U')
- 0 - Quit
Nitro-credits allow turbo controls to be used. They are gradually replenished as you continue the game. Use them wisely - sometimes the ball speeds up and you can only keep up by using turbo controls. A good average score is around 150.
Important note: If you don't want to lose your high-scores, don't store anything in the alpha variable 'H' when using your calculator normally, as this is where high-scores are kept.
The programs
Note on speed
The graphics calculator is not a games console; don't expect Pong to ever go much faster than a dying tortoise (or maybe a racing slug, if you're lucky). However, I've had a few requests for ways to speed it up, so I've now colour-coded sections of code which should be optional (though this hasn't been tested), according to which extraneous feature they provide. If all else fails, go and get yourself a Gameboy, or better still, a life.
Colours
- Red - Nitro (removing this will make the game significantly harder, unless you also remove random bouncing)
- Green - Bat-shrinking (i.e. the bat shrinks as your score increases - removing this will make the game a little easier)
- Ochre - Random bouncing (i.e. the ball will occasionally change speed on bounce - removing this will make the game incredibly boring, but if you want to fiddle you can try and just simplify it)
- Blue - Pause and unpause (this also makes one of the sub-programs unnecessary)
If you choose to omit sections, however, be very careful to not leave in any left-over ':' signs as this will probably break the game. As I couldn't be bothered to make 5 sets of images of different colours, however, the calculator signs represented by images (, for example) will stay black.
PONG
ClrText:0E:8P:1X:1Y:1A:1B:0S:30G:0.2I:4L
Ran#×20R:Int RR:R+1R
RX
Ran#R:R<0.5-1A:R0.51A
Do
ClrText
Locate 1,1,Int G
S<50Locate P,7,"[====]" [Note: here the is missed out if you are missing out the other green bits.]
S50 And S<100Locate P,7,"[===]"
S100 And S<200Locate P,7,"[==]"
S200Locate P,7,"[=]"
Locate Int X,Y,"O"
GetkeyK
K=38P-1P
K=27P+1P
K=36 And Int G>0P-2P
K=36 And Int G>0G-1G
K=26 And Int G>0P+2P
K=26 And Int G>0G-1G
K=73Prog "WAIT"
P<11P
S<50 And P>1616P [Note: once again the counts as part of the green section.]
S<100 And P>1717P
S<200 And P>1818P
S200 And P>1919P
X+AX
Y+BY
X>21-AA
X>21(21+A)X
X<1-AA
X<1(1+A)X
Y<21B
Y=6 And Int X=P-1B
Y=6 And Int X=P+1-1B
Y=6 And Int X=P+2-1B
Y=6 And Int X=P+3 And S<200-1B
Y=6 And Int X=P+4 And S<100-1B
Y=6 And Int X=P+5 And S<50-1B [Note: if you are omitting this section it must be replaced with:
Y=6 And (Int XP And Int XP+5) ]
Y=6 And B=-1G+IG
Y=6Ran#R
Y=6 And B=-1 And R1AA
Y=6 And B=-1 And R0.42A
Y=6 And B=-1 And R0.321A
Y=6 And B=-1 And R0.24-AA
Y=6 And B=-1 And R0.16-2A
Y=6 And B=-1 And R0.08-1A
Y=771K
S+1S
LpWhile K71
ClrText
Locate 1,1,Int G
S<50Locate P,7,"[====]" [Note: Here the is part of the green, again.]
S50 And S<100Locate P,7,"[===]"
S100 And S<200Locate P,7,"[==]"
S200Locate P,7,"[=]"
Locate Int X,Y,"O"
Prog "PAUSE2"
Locate 6,3,"GAME OVER"
S>HLocate 3,4,"NEW HIGH SCORE!"
S>H5L
S>HSH
S<1000Locate 6,L,"SCORE-"
S1000Locate 5,L,"SCORE-"
S<10Locate 14,L,S
S10 And S<100Locate 13,L,S
S100 And S<1000Locate 12,L,S
S1000Locate 12,L,S
WAIT
Do
GetkeyT
T=7171K
T=7172T
LpWhile T72
Return
PAUSE2
For 1T To 300:TT:Next
Return
Notes
Tweaking settings
If you have a look at the first line of the 'PONG' program, you'll see that most of it is a sequence of statements of the form
valname
These are the settings for Pong which affect various elements of the game. You can alter them by changing val. Here's what some of the variables mean:
- S - your initial score
- G - the number of nitro-credits you start with
- I - how many nitro-credits are added per bounce (eg. 0.2=5 bounces to add 1 nitro-credit)
I leave the rest to you to find out (i.e. I've forgotten what they do).
How to find all the programming commands and keys
Here's a list of all the commands and symbols used here and what menus they're accessible from (you may have to scroll along the menu to find them). Note that commands can't just be typed in using the ALPHA key, they have to be selected from the various menus.
Symbols
: PRGM-JUMP-
-
: PRGM-REL-
- : PRGM-REL-
- = : SHIFT-.
- : PRGM-REL-
- < : PRGM-REL-<
- > : PRGM-REL->
- : [i.e. the colon symbol] : PRGM-:
- ClrText : PRGM-CLR-Text
- Ran# : OPTN-PROB-Ran#
- Do : PRGM-COM-Do (it's on the third set of buttons - don't give up)
- Locate : PRGM-I/O-Lcte
- Int : OPTN-NUM-Int
- " : ALPHA (pressing ALPHA or SHIFT-ALPHA brings up a set of punctuation symbols)
- And : OPTN-LOGIC-AND (once again, it's on the third set of buttons)
- GetKey : PRGM-I/O-Gtky
- Prog : PRGM-CTL-Prog
- LpWhile : PRGM-COM-Lp·W (third set of buttons)
- Return : PRGM-CTL-Rtrn
- For : PRGM-COM-For
- To : PRGM-COM-To
- Next : PRGM-COM-Next
This version of Pong designed and implemented by Mark Hutchinson. It is not affiliated in any way to the original.
© Mark Hutchinson 2003
|