Casio Calculator Program Library

Program name: TLGAMES (v. 1.0)  --(Back to Index)--

CTF file name: tlgames.ctf
Author: Tom Lynn
Date: 1997
Last update: 09 March 1997
Models: 9750, 9850, 9950

Description:

   Global subroutines designed for use in games.
   
   This file contains the following global subroutines:
   
   +YESNO    Wait for Y or N to be pressed and return 1 or 0 respectively.
   +SETKEYS  Sets up keys for game (no fire).
   +GK       Wait for any key to be pressed and return the value.
             Used by +YESNO and +SETKEYS.
   +GAMEOVR  Clear the gfx screen and display the message "GAME OVER" nicely.
   GO2       Subroutine of +GAMEOVR, blacks out a character with lines.
              
Program source code:
Program "+YESNO" [Wait for Y or N to be pressed and return 1 or 0 respectively.]

   Lbl 0
   GetKey
   Ans=64=>"NO"
   Ans=64=>Goto 1
   Ans<>32=>Goto 0
   "YES"
   Lbl 1
   Ans=32
              
Program "+SETKEYS" [Sets up keys for game (no fire).]

   "SET KEYS [Y\/N]?"
   Prog "+YESNO"
   Ans=0=>Return
   Lbl 0
   "UP?"
   Prog "+GK"
   Ans->U
   "DOWN?"
   Prog "+GK"
   Ans->D
   "LEFT?"
   Prog "+GK"
   Ans->L
   "RIGHT?"
   Prog "+GK"
   Ans->R
   "OK [Y\/N]?"
   Prog "+YESNO"
   Ans=0=>Goto 0
              
Program "+GK" [Wait for any key to be pressed and return the value.]

   Lbl 0
   GetKey
   Ans=0=>Goto 0
              
Program "+GAMEOVR" [Clear gfx screen and display "GAME OVER" nicely.]

   Cls
   Plot 25,36
   Prog "GO2"
   Text 28,X,"G"
   Prog "GO2"
   Text 28,X,"A"
   Prog "GO2"
   Text 28,X,"M"
   Isz X
   Prog "GO2"
   Text 28,X,"E"
   X+7->X
   Prog "GO2"
   Text 28,X,"O"
   Prog "GO2"
   Text 28,X,"V"
   Prog "GO2"
   Text 28,X,"E"
   Prog "GO2"
   Text 28,X,"R"
   PlotOff X,Y
   Plot 0,0
              
Program "GO2" [Subroutine of +GAMEOVR, blacks out a character with lines.]

   X+7->X
   For 0->I To 5
   F-Line X,Y-I,X+3+(X=46,Y-I
   Next
              


This page was created by Tom Lynn (tom-calcs@mythic-beasts.com).
This page last updated: Friday, 30 April, 1999

Written in notepad and compiled with WTA, for clean, consistent HTML.
Part of the Casio Graphical Calculator Encyclopaedia.

Best Viewed With Any Browser