150 likes | 229 Views
Game Programming. on the TI series calculators. By Chris Williams & William Lord. Two languages available. Assembly Basic. Assembly. allows sound allows high level graphics compiled language typically large large degree of flexibility. Basic. primarily text-base
E N D
Game Programming on the TI series calculators By Chris Williams & William Lord
Two languages available • Assembly • Basic
Assembly • allows sound • allows high level graphics • compiled language • typically large • large degree of flexibility
Basic • primarily text-base • easy to read and write • interpretive language • typically small size • similar to PC basic • limited functionality
Output • Three forms: • Disp - standard output • Outpt( - defined location • Text( - in graph window
This screen demonstrates the disp output function. Code: 1.) Program:hello :ClLCD :Disp " HELLO WORLD","---------" Program:hello :ClLCD :OutPt(7,0 "HELLO WORLD" :OutPt(0,10 "---------" Program:hello :ClGRW :Text(7,0 "HELLO WORLD" :Text(0,10 "---------" :Pause
Input • for integers • Input “prompt” , variable • for text • InpSt “prompt” , variable • Each key has it’s own address • the program can wait for a specific keystroke.
This screen demonstrates the input function. Code: 2.) Program:Pokemon :Input "*Selection: ", Var1 Program:Pokemon :InpSt "*Name: ", Name1 getKy->K If K==105:Then Disp "You pressed Enter." End
Variables • Defined during assignment • integers • “number” variable • strings • “String” Variable
Function keys • Assigned with menu command • each key has it’s own address • usage • menu( 1, “title”, goto, ...
This screen demonstrates the function keys. Code: 4.) Program:PRS :Lbl Top :ClLCD :Disp "Paper Rock or Scissors" :Menu(1,"Pap",ramp,3,"Roc” ,ramr,5,"Sci",rams
Gotos • Program is segmented by labels • Lbl LABEL • gotos transfer control to a label • Goto LABEL