`Xm[-dUDF7" 5 *>8a4AL *=@"JA; L>R@_VA?YC?[DXbGktD^?Dx ڙD@4tc= \MyStuff\Projects\Programming\OPL\Meteoroid\Sysram1.sis\MyStuff\Projects\Programming\OPL\Meteoroid\MUSIC.SIS\MyStuff\Projects\Programming\OPL\Meteoroid\SrcRelease\ini.opm!:\Meteoroid\ini.opm\MyStuff\Projects\Programming\OPL\Meteoroid\SrcRelease\PC_Bar.opm!:\Meteoroid\PC_Bar.opm\MyStuff\Projects\Programming\OPL\Meteoroid\SrcRelease\music.oxh!:\Meteoroid\music.oxh\MyStuff\Projects\Programming\OPL\Meteoroid\SrcRelease\Pc_bar.omh!:\Meteoroid\Pc_bar.omh\MyStuff\Projects\Programming\OPL\Meteoroid\SrcRelease\ini.omh!:\Meteoroid\ini.omh\MyStuff\Projects\Programming\OPL\Meteoroid\SrcRelease\Loader.oph!:\Meteoroid\Loader.oph\MyStuff\Projects\Programming\OPL\Meteoroid\SrcRelease\defaults.oph!:\Meteoroid\defaults.oph\MyStuff\Projects\Programming\OPL\Meteoroid\SrcRelease\constants.oph!:\Meteoroid\constants.oph\MyStuff\Projects\Programming\OPL\Meteoroid\SrcRelease\declarations.oph!:\Meteoroid\declarations.oph\MyStuff\Projects\Programming\OPL\Meteoroid\SrcRelease\Meteoroid.hlp!:\Meteoroid\Meteoroid.hlp\MyStuff\Projects\Programming\OPL\Meteoroid\SrcRelease\Meteoroid.mbm!:\Meteoroid\Meteoroid.mbm\MyStuff\Projects\Programming\OPL\Meteoroid\SrcRelease\Meteoroid.icn!:\Meteoroid\Meteoroid.icn\MyStuff\Projects\Programming\OPL\Meteoroid\SrcRelease\Meteoroid!:\Meteoroid\Meteoroid\MyStuff\Projects\Programming\OPL\Meteoroid\SrcRelease\Readme!:\Meteoroid\ReadmeMr. Meteoroid Game SourcesmmdDFjj$r!\epoc32\release\MARM\rel\Sysram1.opx!:\System\OPX\Sysram1.opxSysram1 OPX Symbian Ltdy]6̙EPOC '4OnƮK   |l ^:99 7 5444443A-MpP04*0 `@@-0 0Ѝ`0@ 0P @ @t y @v 08 l 08  8 f 08qЍG- Mpl@ifMNPKPGO04*` 00CS0 T  2F/ 0PP61! 0P1  ` P@ P-0 Ѝ@@ t@tX  @ 0f8ͫ 80X0C080 08A Ѝ0@-MP@ @XH@@X 00SЍ0@-Mp`@P @  PЍ@-@@@-M@ AЍ@-M@ A|Ѝ@-M@ 0AoЍ@-M@   A]Ѝ0@-MP  @ AJЍ0@-M@    0 A7Ѝ0@-DM@ P@/P47Dߍ00@-M@H_@/JJ4P Jtߍ0p@-(M`P@U q @ͫ(Ѝpp@-(M`P@ U \ @yͫ(Ѝp@-@pP@p@-EM`PUP<@`A,00 500@ VͫEߍpp@-EM`PUP@?A<00 00@ 5ͫEߍp@-@M@ &P0S}@ߍA-MdO`P,_10@/O0 02O0 D_@/fffO`X01 "ͫߍA-Mp/@ ` @P ` @$$%PpX  "  !ЍG-hM@h@@/VbVPJ@00Pp P4V @ 0|@P xxl@50x PUU u x{4P@R@PK NPL0S P @1 4P20S 0p $P p0S V1 M@s똠` oP[P @PP Tp @FR ͫͫ0  hߍ000@-@P0(00@-EMPFP @C0  nEߍ0@-@2P3@-@a00p@-P`@P  @P :pp@-M`JO@/L"L.L"P@ 00@/ 0 LJ_jP J_0(1 @p# L= Z@P88@J1dͫͫͫߍp@-@y00@-@0P @0@-P@P  00 0 0@-@P000 P 0V0@AQ[ $0<HT`lx @  7   Z ^ g p z        & D N   ;ͫPQ0@-P@P^@0R48<@HL0D,(t$`Xl\T| pxPd h  ,0$(4<8@LHDTP\X`dhlpxt|9@-@E   4 L d000 Jas#5PYn8.H89:;<>?9;>LdjGI' f,.1=LNQRTW\bS Z[ \^hi "3>WZA$&/QT&2: kSoundZ:\SYSTEM\PROGRAMS\.EXE::MainApMIME.OPX,$(3Jas#5PYn8.H89:;<>?9;>LdjGI' f,.1=LNQRTW\b/S Z[ \^hi "3>DWWZAk$&/QT&2: kEUSER[100000c1].DLLOPLR[10000077].DLLAPGRFX[1000011b].DLLBAFL[1000004e].DLLEDBMS[100000df].DLLEFSRV[100000bd].DLLCONE[1000004d].DLLAPPARC[100000de].DLLAPFILE[1000013f].DLLWS32[1000017d].DLL`,0000D0T0`0l0x000 ;$;,;\?`???4x022$2P223,3034383<3@3D3H3L3P3T3X3\3`3d3h3l3p3t3x3|3335 55$505<5H5T5`5l5x55555555555566 6,686D6P6\6h6t666666666666777(747@7L7X7d7p7|777777777778 88$808<8H8T8`8l8x88888888888899 9,989D9P9\9h9t999999999999::<<<<<<<=== mRnZ21dDFjj"r \epoc32\RELEASE\MARM\REL\Music.opx!:\SYSTEM\OPX\Music.opxMusic OPX Symbian Ltdy] jEPOC ^}l_G)h |^HGG E CBBBBBA@-@l @ 08 S6@aͫE-0Mp\YdX!`V(@P,Y$`-`-`-P-0< 4Ѝ   0?KPRe;>'QRWaSoundD PY8H89:;<>?KPRe;>'QRWaEUSER[100000c1].DLLOPLR[10000077].DLLp3p0000D0T0`0l0x0001334444485D5P5\5h5t555555555555666(646@6L6X6d6p6|666T7X7\77sh9fD:\opm\ini\ini.pre  INI_VERSION%+*.ini file creation and modification module++VS|*Y@VOOWK+ 1999 SymbianK(++This module can only be usedO++within an OPL applicationO+OKO (H W7v" __CREATEINI%r+" K+"K+4 SELECT name,string,integer,long,float FROM deftableKNAME$STRING$INT%LONG&FLOATO OSO@[OztOw+" K+"K+; FIELDS name(32),string(255),integer,long,float TO deftableKNAME$STRING$INT%LONG&FLOAT O  *v'  OOOWT{ O{&H  __FINDINI&D" OS+"O{A[+NAME$' +STRING$' ,w(D  __FINDINI&@" OS+"O{A[+NAME$' +INT%$ ,t&D  __FINDINI&@" OS+"O{A[+NAME$' +LONG&% ,u&D __FINDINI&@" OS+"O{A[+NAME$' +FLOAT& ,v!'d  __FINDINI&&" OS"O{A[1++NAME$' +STRING$' ,' '+STRING$# ' '(a  __FINDINI&S" OS"O{A[.++NAME$' +INT%$ ,& &+INT%  & &*c  __FINDINI&U" OS"O{A[/++NAME$' +LONG&% ,& &+LONG&! & &.c __FINDINI&U" OS"O{A[/++NAME$' +FLOAT& ,& &+FLOAT" & &486" INI_OPEN% INI_WRITE$ INI_CLOSE 4OS[O+INILastUsedFileO 6OS 4OS)O56? ! INI_OPEN% INI_READ$ INI_CLOSE5 3OS[ 6+*6+INILastUsedFileO+OS 3OS(6$"  __FINDINI& OS O{E[+,vOgINIMAIN'P INI_OPEN%\ __CREATEINI%n INI_CLOSEF __FINDINI&h INI_WRITE$ INI_WRITE%  INI_WRITE&n INI_WRITE INI_READ$6 INI_READ% INI_READ&><INI_READYSETLASTUSEDFILE%DvGETLASTUSEDFILE$ INI_DELETE& INI_VERSION%gSYSRAM1h |7sh9fp $D:\Development\OPM\pc_bar\pc_bar.pre!#PC_BAR_VERSION%+Progress bar module++VS|*Y@VOOWK+ 1999 SymbianK(OH++This module can only be usedO++within an OPL applicationO+OKO (H(H W7v  v(9  _PC_FONTSIZE&3O{WK3O{A[O{3!3O{I#3O{I%3O{I'3O{I)3O{I+3O{I'OS3O{I -3O {I /3O{I13O{IO31 )O0[)O0[ ))  )U({]x ({U({]x ({]x$vCY. )_PC_BAR_INITIALISE& _PC_DESTROY_STRUCT;O0;O?8`[O{U=O?OAOCOEOGO IO KOMOSUO{5[O{QO{WKQO{A[UOS'O{OW+b;DZQO{IUQO{I(xQ;EO@[=?CLACۿ=?ALCAODZQUOS'QOS'O{;W.)_PC_BAR_INITIALISE& _PC_DESTROY_STRUCT;OD;OD\;OD\;OD\[O{?W+OIW.KW/MOOOOH;O@[SOUOf;O@[!SI(LO LUKOLO L?;O@[SI(LO LUO;O@[SOUKOLO LEMOOO(OOOOO=O_O)OOdOSEO{5[O{AO{WKAO{A[O{QSU(OHOOHOOO`W9QQDZOO(H(HAO{IEAO{I(;AQMOOL(O?DZAEOS'AOS'W{Ju65_PC_BAR_INITIALISE& _PC_COLOUR_PC_DESTROY_STRUCTQW+O[W.]W/_O aOOH)m[|O|(,| GW2| IW2| KW2|WJWyoOO HqOsO G+G[+ooOHqqOHssOHaaOH I+G[.ooOHqqOHssOHaaOH!aaOHooOHssOH K+G[ooOHssOHOH ooOHi[mLOTk]oLOTW_OaOmOLOOOOOMO_O)OOdOSWO{5[O{SO{WKSO{A[O{gikmoO(W9gDZOO(H(H G+G[YOOOHOH)OS'mO LOOO)OS'mO LOOO OOH_OS' GmOLW3 I+G[m IW2LOTq_OS' I K+G[m KW2LOTs_OS' KSO{IWSgSO{I( _aOLmOLOQDZSWOS3SOS3W{%(3_PC_DESTROY_STRUCT &O{9[+ &O{IW(x@[ &O{IWCOS &OSv%(9_PC_DESTROY_STRUCT &O{9[1 &O{IW(;@[! &W &O{IWCOS &OSv%(9_PC_DESTROY_STRUCT &O{9[1 &O{IW( @[! &W &O{IWCOS &OSv%p _PC_COLOURF0 O{A[O* W& O{IWC.W+`*DZ"&b"Wd"O{IWf"O{IWh"O{IWj"O{IWl"O{IWn"O{IW j8[,fOL- O0[ ,O,fOL|Wj|V |Ry"O {IWCOSlO@[.bOH,HdOHhLf,LOLhOLO߿'bOHdOHfLhOLf,LOLO"O{IWCOSlO@[#bOHdOHhL,hOLO߿ bOHdOL,LhOL,OnOD[nO@[1GOd|O| |Wj|WWRj|VWB}OW+%K%nO@[GO| |Wj|WOW·O2W^O 2{)QO 2{I"O{IWCO2WlO@[*bfGW2LOTHdhO2LOTLOLҿ'bhGW2LOTHdfO2LOTLOLOG^ʱ WOgPC_MAIN9w_PC_DESTROY_STRUCT_PC_BAR_INITIALISE& _PC_FONTSIZE& _PC_COLOUR PC_FREEBAR&Z PC_GIBAR& PC_ALERTBAR&sPPC_DESTROY_FREEBARzPC_DESTROY_GIBARPC_DESTROY_ALERTBAR4 PC_BAR_UPDATE% PC_BAR_VERSION%J Lh _ 7mcU \cdREM ALARM.OXHREMREM Copyright (c) 1997-1999 Symbian Ltd. All rights reserved.REMCONST KOpxMusicUid&=&10000B91CONST KOpxMusicVersion%=$500DECLARE OPX MUSIC,KOpxMusicUid&,KOpxMusicVersion% MusicDTMF:(aDtmf$) : 1 MusicSetVolume:(aVolume%) : 2 MusicNote:(aPitch&, anAmplitude&): 3 MusicStop: : 4END DECLARE\ccefd\ckefdV.A*TextEd.apps7mcUt \cd"REM PC_BAR.OMH version 1.03rem Header File for PC_BAR.OPMrem Copyright (c) 1999 Symbian Ltd. All rights reserved.REM Bar Text FormatREM ---------------CONST KPcBarTextNone%=0CONST KPcBarTextPercent%=1CONST KPcBarTextNumber%=2REM ColoursREM Bar Colour - 2 ColourREM ---------------------CONST KPcBarColourWhite&=&F0F0F0CONST KPcBarColourBlack&=&000000CONST KPcBarColorWhite&=&F0F0F0CONST KPcBarColorBlack&=&000000REM Bar Color - 4 Color (plus white and black)REM --------------------------------------------CONST KPcBarColourDkGrey&=&505050CONST KPcBarColourLtGrey&=&A0A0A0CONST KPcBarColorDkGrey&=&505050CONST KPcBarColorLtGrey&=&A0A0A0REM Bar Color - 16 Color (plus white and black)REM ---------------------------------------------CONST KPcBarColourGrey1&=&101010CONST KPcBarColourGrey2&=&202020CONST KPcBarColourGrey3&=&303030CONST KPcBarColourGrey4&=&404040CONST KPcBarColourGrey5&=&505050CONST KPcBarColourGrey6&=&606060CONST KPcBarColourGrey7&=&707070CONST KPcBarColourGrey8&=&808080CONST KPcBarColourGrey9&=&909090CONST KPcBarColourGrey10&=&A0A0A0CONST KPcBarColourGrey11&=&B0B0B0CONST KPcBarColourGrey12&=&C0C0C0CONST KPcBarColourGrey13&=&D0D0D0CONST KPcBarColourGrey14&=&E0E0E0CONST KPcBarColorGrey1&=&101010CONST KPcBarColorGrey2&=&202020CONST KPcBarColorGrey3&=&303030CONST KPcBarColorGrey4&=&404040CONST KPcBarColorGrey5&=&505050CONST KPcBarColorGrey6&=&606060CONST KPcBarColorGrey7&=&707070CONST KPcBarColorGrey8&=&808080CONST KPcBarColorGrey9&=&909090CONST KPcBarColorGrey10&=&A0A0A0CONST KPcBarColorGrey11&=&B0B0B0CONST KPcBarColorGrey12&=&C0C0C0CONST KPcBarColorGrey13&=&D0D0D0CONST KPcBarColorGrey14&=&E0E0E0REM Freebar DirectionREM -----------------CONST KPcBarHorizontal%=0CONST KPcBarVertical%=1REM External declarationsEXTERNAL pc_gibar&:(location%, textformat%)EXTERNAL pc_alertbar&:(title$, textabove$, textbelow$, textformat%, divisions%)EXTERNAL pc_destroy_freebar:(freebar&)EXTERNAL pc_destroy_gibar:(gibar&)EXTERNAL pc_destroy_alertbar:(alertbar&)EXTERNAL pc_bar_update%:(bar&,position%)EXTERNAL pc_freebar&:(winID%,x%,y%,length%,width%,direction%,textformat%,forecolour&,backcolour&,divisions%)EXTERNAL pc_bar_Version%:\cefd\cefd.A*TextEd.appe 7mcU'\cdm rem INI.OMH version 1.03rem Header File for INI.OPMrem Copyright (c) 1999 Symbian Ltd. All rights reserved.EXTERNAL inimain:EXTERNAL INI_Open%:(inifile$)EXTERNAL INI_Close:(inifile$)EXTERNAL INI_WRITE$:(name$,string$)EXTERNAL INI_WRITE%:(name$,int%)EXTERNAL INI_WRITE&:(name$,long&)EXTERNAL INI_WRITE:(name$,float)EXTERNAL INI_READ$:(name$,default$)EXTERNAL INI_READ%:(name$,default%)EXTERNAL INI_READ&:(name$,default&)EXTERNAL INI_READ:(name$,default)EXTERNAL SETLASTUSEDFILE%:(inifile$,FileName$)EXTERNAL GETLASTUSEDFILE$:(IniFile$)EXTERNAL INI_Delete:(name$)EXTERNAL INI_Version%:\cefd\cefd.A*TextEd.app7mcU&\cdiREM Constants for the OPM Loader proceduresCONST KStandardOPMPath$="\System\OPM\"CONST KOPMExtension$=".OPM"REM * OPM STUFF *REM Headers from procedures in file "Loader.tpl", includedREM with OPMs downloaded from Symbian.EXTERNAL OPM_FileLoc$:(file$)EXTERNAL OPM_LoadModule:(modulename$)EXTERNAL OPM_UnloadModule:(modulename$)\cefd\cefd.A*TextEd.app7mcU\cdyREM *******************************REM **** ****REM **** MR. METEOROID GAME ****REM **** v0.85(beta) ****REM **** 2000 Malcolm Tyrrell ****REM **** ****REM *******************************REM **************************REM **** ****REM **** Program Defaults ****REM **** ****REM **************************REM *****************REM **** ****REM **** License ****REM **** ****REM *****************REM You can redistribute, modify this source code and/or use bitsREM of it in your programs. Hurray!REM ******************REM **** ****REM **** Warranty ****REM **** ****REM ******************REM This source is distributed in the hope that it will be useful,REM but WITHOUT ANY WARRANTY; without even the implied warranty ofREM MERCHANTABILITY or FITNESSFORAPARTICULAR PURPOSE.REM See the help file for details.REM * Application defaults *REM s,x,k,mCONST D_app_initKey1%= 115CONST D_app_initKey2%= 120CONST D_app_initKey3%= 107CONST D_app_initKey4%= 109REM * Sound defaults *CONST D_sound_on%=Kfalse%CONST D_sound_volume%=2REM * High Score defaults *REM there should be K_hs_tableSize% of theseCONST D_hs_name1$="AAA"CONST D_hs_name2$="AAA"CONST D_hs_name3$="AAA"CONST D_hs_name4$="AAA"CONST D_hs_name5$="AAA"REM there should be K_hs_tableSize% of theseCONST D_hs_score1&=2000CONST D_hs_score2&=1000CONST D_hs_score3&=500CONST D_hs_score4&=250CONST D_hs_score5&=100\cDefd\cLefd.A*TextEd.appT7mcU\cd9DREM *******************************REM **** ****REM **** MR. METEOROID GAME ****REM **** v0.85(beta) ****REM **** 2000 Malcolm Tyrrell ****REM **** ****REM *******************************REM ******************************REM **** ****REM **** Constant Definitions ****REM **** ****REM ******************************REM *****************REM **** ****REM **** License ****REM **** ****REM *****************REM You can redistribute, modify this source code and/or use bitsREM of it in your programs. Hurray!REM ******************REM **** ****REM **** Warranty ****REM **** ****REM ******************REM This source is distributed in the hope that it will be useful,REM but WITHOUT ANY WARRANTY; without even the implied warranty ofREM MERCHANTABILITY or FITNESSFORAPARTICULAR PURPOSE.REM See the help file for details.REM * Application constants *CONST K_app_name$="Mr. Meteoroid Game"CONST K_app_version$="v0.85beta"CONST K_app_uid&=268458080REM the filebase is used for the main directory, the .app/.opo,REM .mbm, .ini and .hlp files.CONST K_app_fileBase$="Meteoroid"REM these match G_app_state%CONST K_app_stateLeaveApp%=10CONST K_app_stateInApp%=20CONST K_app_stateRestartGame%=30CONST K_app_stateInGame%=40CONST K_app_stateInLevel%=50CONST K_app_stateInPause%=60REM * Game Constants *CONST K_game_initEnergy%=200CONST K_game_maxNumAsts%=4CONST K_game_levelBonus&=56REM * Level Constants *REM this is a ratio of the space window sizeCONST K_level_normAstSpeed=0.00888CONST K_level_normBaseRot=0REM Timing constantsCONST K_level_astMoveTimeDelay&=33000REM Time interval between each time each asteroid is drawnCONST K_level_astDrawTimeDelay&=80000REM * HiScore Constants *REM having too many entries in the table, could be a problemREM on small screens.CONST K_hs_tableSize%=5REM * Graphic Constants *CONST K_factor&=10000REM * Base Constants *REM these two are ratios of the space window sizeCONST K_base_initBaseSize=0.125CONST K_base_maxBaseSize=0.33333REM these two are ratios of the base sizeCONST K_base_borderFactor=0.9CONST K_base_ShieldFactor=0.06666REM by experiment, these values seem to work.CONST K_base_labelXOffset& = -40000CONST K_base_labelYOffset& = 60000REM * Asteroid Constants *CONST K_ast_smallScore&=11CONST K_ast_bigScore&=23CONST K_ast_smallDamage%=45CONST K_ast_bigDamage%=80REM * Bitmap Stuff *CONST K_bm_extension$=".mbm"REM indices into the file K_app_fileBase$+K_bm_extension$CONST K_bm_titleMrIndex%=0CONST K_bm_titleMeteoroidIndex%=1CONST K_bm_titleGameIndex%=2CONST K_bm_panelScoreIndex%=3CONST K_bm_panelEnergyIndex%=4CONST K_bm_screenBGIndex%=5CONST K_bm_bigAstIndex%=6CONST K_bm_bigAstMaskIndex%=7CONST K_bm_smallAstIndex%=8CONST K_bm_smallAstMaskIndex%=9REM * Space Stuff *REM Sensible limit valuesREM Reasons why I limit the size of the space window,REM given that the game code would will scale:REM the sprites are fixedREM the font on the base is fixedREM in large space windows, the sprites would jump too muchCONST K_space_minSize%=160CONST K_space_maxSize%=240REM * Title Stuff *CONST K_title_xDim%=120REM these are limits, it can have values in betweenCONST K_title_yDimBig%=140CONST K_title_yDimSmall%=80REM * Panel Stuff *CONST K_panel_xDim%=120REM these are limits, it can have values in betweenCONST K_panel_yDimBig%=140CONST K_panel_yDimSmall%=80REM this font kind of matches the size of the prerendered REM "Score/Energy" textCONST K_panel_scoreFont&=KFontArialNormal18&CONST K_panel_scoreFontHeight%=17REM time interval between panel updatesCONST K_panel_timeDelay&=150000REM * Sound Stuff *CONST K_sound_highPitch&=600CONST K_sound_midPitch&=475CONST K_sound_lowPitch&=300CONST K_sound_amplitude%=100CONST K_sound_duration&=20000REM * High Score Stuff *REM this is also used by the panel and the game over dialog.CONST K_hs_numDigits%=9REM * .ini file stuff *CONST K_init_drive$="C:"CONST K_init_path$="\System\Apps\"CONST K_init_extension$=".ini"REM * Help file stuff *CONST K_help_extension$=".hlp"\c4efd\c<efd.A*TextEd.appD7mcUR\cdBREM *******************************REM **** ****REM **** MR. METEOROID GAME ****REM **** v0.85(beta) ****REM **** 2000 Malcolm Tyrrell ****REM **** ****REM *******************************REM ********************************REM **** ****REM **** Procedure Declarations ****REM **** ****REM ********************************REM *****************REM **** ****REM **** License ****REM **** ****REM *****************REM You can redistribute, modify this source code and/or use bitsREM of it in your programs. Hurray!REM ******************REM **** ****REM **** Warranty ****REM **** ****REM ******************REM This source is distributed in the hope that it will be useful,REM but WITHOUT ANY WARRANTY; without even the implied warranty ofREM MERCHANTABILITY or FITNESSFORAPARTICULAR PURPOSE.REM See the help file for details.REM * The Main Procedure *EXTERNAL main:REM * Application Stuff *EXTERNAL app_initialise:EXTERNAL app_loop:EXTERNAL app_close:EXTERNAL _app_getPathAndDrive:REM * Game Stuff *EXTERNAL game_initialise:EXTERNAL game_loop:EXTERNAL game_close:REM * Level Stuff *EXTERNAL level_initialise:(level%)EXTERNAL level_loop:(level%)EXTERNAL level_close:EXTERNAL _level_astInitialise:(num%)EXTERNAL _level_astCheck:(timenow&)EXTERNAL _level_numAstsAt%:(level%)REM * Pause Stuff *EXTERNAL pause_initialise:EXTERNAL pause_loop:EXTERNAL pause_close:REM * BASE GRAPHICS STUFF *EXTERNAL base_initialise:EXTERNAL base_draw:EXTERNAL base_delete:EXTERNAL base_updateShield:(shield%)EXTERNAL base_growBase:EXTERNAL base_rotateBase:EXTERNAL base_moveBase:(dispFactor)EXTERNAL base_close:EXTERNAL _base_drawBase:(see%)EXTERNAL _base_drawShield:(see%)EXTERNAL _base_drawLabels:(see%)EXTERNAL _base_drawSquare:(factor&,x&,y&,size&,rot)EXTERNAL _base_drawEdge:(factor&,x&,y&,size&,rot,edge%)EXTERNAL _base_setGrey:(grey%)REM * Asteroid Graphics Stuff *EXTERNAL ast_initialise:(num%,size%)EXTERNAL ast_draw:(num%)EXTERNAL ast_explode:(num%)EXTERNAL ast_newStartPosition:(num%)EXTERNAL ast_updateProperties:(num%,speed&)EXTERNAL ast_close:(num%)EXTERNAL _ast_createSmallAst&:EXTERNAL _ast_createBigAst&:REM * Screen Stuff *EXTERNAL screen_initialise:EXTERNAL screen_close:EXTERNAL _screen_arrange:(screen_xDim%,screen_yDim%)EXTERNAL _screen_SizeNotSupported:REM * Space Window Stuff *EXTERNAL space_initialise:(xPos%,yPos%,xDim%,yDim%)EXTERNAL space_close:EXTERNAL _space_build:(xPos%,yPos%,xDim%,yDim%)REM * Title Window Stuff *EXTERNAL title_initialise:(xPos%,yPos%,xDim%,yDim%)EXTERNAL title_close:EXTERNAL _title_build:(xPos%,yPos%,xDim%,yDim%)REM * Panel graphics *EXTERNAL panel_initialise:(xPos%,yPos%,xDim%,yDim%)EXTERNAL panel_check:(timenow&)EXTERNAL panel_update:EXTERNAL panel_close:EXTERNAL _panel_build:(xPos%,yPos%,xDim%,yDim%)EXTERNAL _panel_printScore:EXTERNAL _panel_printEnergy:REM * .ini File Stuff *EXTERNAL init_initialise:EXTERNAL init_useDefaults:EXTERNAL init_close:EXTERNAL _init_readInits:EXTERNAL _init_writeInits:REM * Bitmap Stuff *EXTERNAL bm_initialise:EXTERNAL bm_close:REM * Menu*EXTERNAL menu_display:REM * Commands *EXTERNAL cmd_checkSysKey%:(key&)EXTERNAL cmd_restart:EXTERNAL cmd_exit:EXTERNAL cmd_quit:EXTERNAL cmd_pause:REM * Help Stuff *EXTERNAL help_initialise:EXTERNAL help_display:EXTERNAL help_close:REM * Preferences *EXTERNAL pref_change_keys:EXTERNAL pref_restore_defaults:REM * About *EXTERNAL about_display:REM * High Scores *EXTERNAL hs_display:EXTERNAL hs_gameover%:(score&)EXTERNAL _hs_getPlayerName$:REM * Sound Stuff *EXTERNAL sound_initialise:EXTERNAL sound_setupDialog:EXTERNAL sound_highBeep:EXTERNAL sound_midBeep:EXTERNAL sound_lowBeep:EXTERNAL sound_check:(timeNow&)EXTERNAL sound_stop:EXTERNAL sound_close:REM * Misc Tools *EXTERNAL misc_padWithZeroes$:(width%,number&)EXTERNAL misc_confirm%:(title$,question$)REM * Test Stuff *EXTERNAL test_specificDevices:\cefd\cefd.A*TextEd.appCPmU@5 @ @"Data.app@=)@ .12 7 ;@O&L@iTable1 ColA9ColB9ColA10ColB10ColA12ColB12 @ Table1 Title: d*Help Text: d&Keywords: d@   OOO   O'! "Arial$#OOAI'd like to thank: Glenn Strong for discussion and beta testing. Ray Larabie for his lovely Soviet font. Check out his other fonts at http://www.larabiefonts.com The GNU project for their Warranty. (I would have GPLed this program if it didn't use Symbian's OPMs). @= @<v. I encourage you to use bits of it in your own projects (with the condition that they also are GPLed see the GPL).;DSketch(c?ccc?c;c/c@]>cccpzc~c~cC׹c}c}c\u.c}c}c5c|ccc}&Paint.app} F*D Sketch""""(""?ngngng??ngng^ngng?@;ngе^뺿ng}ng}ngCu^+ng}?ng}ngPu׺ng}}ng}}ngCz׺ngngngPz]zng}>ng}>ng׵^z;ng|ng?p}ngu]ung}ng?}ng?p]ung?}ng=ngngng}&Paint.app}Fb*oD~!QIQDNO WARRANTYBECAUSE THE PROGRAM IS FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPARE OR CORRECTION.IN NO EVENT UNLESS REQUIRED BY LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCULDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.BF ,ꮙ:Mr. Meteoroid Game"Welcomes to you, fellow shield-operatron of planetoid defence. Again we must defendinate our glorious planetoid against descending space-bits. If only we can achievify high scorings before our inevitable doomage" IntroductionVMr. Meteoroid Game v0.85beta2000 Malcolm Tyrrell.A lo-fi game for you to enjoy. The GameThe object of the game is to gain lots of points. Points are gained when a meteoroid strikes your shield, or when you pass a level.The game ends when you have lost all your energy. You lose energy when a meteoroid strikes your base. ControlsYou use keys to activate your shields.The key for each shield is marked on the side of the base that it protects.You can change the keys. Use the menu command: "Change Keys"ScoringfPoints are given as follows:11 points for a .23 points for a .56 points for each level passed. ;SoundIf you wish to enable beeps, you can switch on sound. Use the "Sound Setup" controls in the menu.On slower devices, this may cause the game to slow down slightly. Warranty LicensegMr. Meteoroid Game is 2000 Malcolm Tyrrell.This program is freeware; you may freely distribute it. ContactsHe-mail: tyrrelmr@cs.tcd.iewww: http://www.cs.tcd.ie/Malcolm.TyrrellSource AvailableThe complete source code is available for your perusal and should have come with the program. If do you use any bits of it in your own programs, I encourage you to make them open source. I do not demand it.Acknowledgements R J "gM 647B9d9G ( ? . -       @  ////// /t(l/ ? /  . /  @-     /  B / /  / / B / /  / / B  / @  / B  /  / B */  // B /  /@ B /  / @     x(2  / d/j / // // // //n // / / / n / /  / / d/ / / /j /  d/  /  / (0//)+)>>C>@> >@/?o> >0)/?8//8/=((:꿾꿪꯾.>.>)>>> >> >>@@@oV*  408?8*8/8==h(/|9?>~~Ͻ߼s|/9?~>~ν߳Ͻ߼s(""???^?@;е^뺿}}Cu^+}?}Pu׺}}}}Cz׺Pz]z}>}>׵^z;|?p}u]u}?}?p]u?}=(""???????(??;/<@]>0pz3~0~0C׹}}\u.}<}5|(??<0000< `P ) 7B9d9G(?N_?M7?/w?O?/?*++P)C_UUU(?N?????(( N?÷???ÿ~?ÿ*}?6?<7&G*k??3o ̯C0z*dT PC%ZWUUUnVUY몪U( ????????? ? h(00?<ݼ???뻿??8=?Hÿ3?< ?*2Jn??*k3#?3Cn.PK_app_stateInApp% REM Enter a game game_initialise: game_loop: game_close: IF G_app_interact% IF hs_gameover%:(G_game_score&) hs_display: ENDIF ENDIF IF G_app_state%=K_app_stateInApp% G_app_interact%=KTrue% ELSEIF G_app_state%=K_app_stateRestartGame% G_app_state%=K_app_stateInGame% G_app_interact%=KFalse% ENDIF ENDIF UNTIL G_app_state%K_app_stateInGame% REM move on to level state level_initialise:(level%) level_loop:(level%) level_close: IF G_app_state%=K_app_stateInGame% G_app_interact%=KTrue% ENDIF ENDIF UNTIL G_app_state%1 base_rotateBase: ENDIF base_growBase: base_moveBase:(1) G_base_shield%=0 base_draw: REM initialise asteroid properties G_level_numAsts%=_level_numAstsAt%:(level%) G_level_numKills%=10 num%=1 DO _level_astInitialise:(num%) num%=num%+1 UNTIL num%>G_level_numAsts% REM prepare the asteroid-drawing time structures G_level_astTrav%=1 REM if the state is where it should be, return to REM interactive mode. IF G_app_state%=K_app_stateInLevel% G_app_interact%=Ktrue% ENDIFENDPPROC level_loop:(level%) EXTERNAL G_app_state%,G_app_interact% EXTERNAL G_app_key%(),G_level_numAsts% EXTERNAL G_ast_x&(),G_ast_y&(),G_ast_dx&(),G_ast_dy&() EXTERNAL G_ast_distToShield&(),G_ast_side%(),G_ast_distToBase&() EXTERNAL G_ast_score&(),G_ast_damage%() EXTERNAL G_base_x&,G_base_y&,G_base_shield%,G_game_energy% EXTERNAL G_game_score& EXTERNAL G_level_numKills%,G_space_xDim& LOCAL num%,base_ast_dist&,kills% LOCAL stat%,thisEvent&(16) REM * Time stamps for the loop * REM Time at last loop end LOCAL timenow& REM Time that the asteroids were last moved LOCAL astMoveTimeLast& REM WARNING: One big procedure coming up! It really needs to REM be broken up. Some day REM It also should be noted that I didn't bother learning REM exactly how event handling should be done. REM initialise timestamps timenow&=DTNow&: astMoveTimeLast&=DTNow&: REM make sure that any pending event gets dealt with GETEVENTA32 stat%,thisEvent&()  DO REM * Draw asteroids * _level_astCheck:(timenow&) REM * Move asteroids * IF DTMicrosDiff&:(astMoveTimeLast&,timenow&)>K_level_astMoveTimeDelay& REM it's time to move the asteroids num%=1 DO REM * move asteroids towards base * G_ast_x&(num%)=G_ast_x&(num%)+G_ast_dx&(num%) G_ast_y&(num%)=G_ast_y&(num%)+G_ast_dy&(num%) REM * Detect collision with shield * base_ast_dist&=(((G_ast_x&(num%)-G_base_x&)/K_factor&)**2+((G_ast_y&(num%)-G_base_y&)/K_factor&)**2) IF base_ast_dist& < G_ast_distToBase&(num%) REM * asteroid hits base * REM destroy asteroid ast_explode:(num%) sound_lowBeep: ast_newStartPosition:(num%) REM increase kills kills%=kills%+1 IF kills%<=G_level_numKills%-G_level_numAsts% REM if more asteroids are necessary, reset this one ast_updateProperties:(num%,K_level_normAstSpeed*G_space_xDim&) ELSEIF kills%=G_level_numKills% REM level finished, REM update score G_game_score&=G_game_score&+K_game_levelBonus& REM and leave the level loop G_app_state%=K_app_stateInGame% ENDIF REM decrease energy force G_game_energy%=G_game_energy%-G_ast_damage%(num%) IF G_game_energy%<=0 REM player out of energy, exit the game G_app_state%=K_app_stateInApp% ENDIF ELSEIF base_ast_dist& < G_ast_distToShield&(num%) REM * asteroid is close enough to hit a shield * IF G_base_shield% AND ((G_ast_side%(num%) AND (2**(G_base_shield%-1)))>0) REM * asteroid actually hits the current shield * REM destroy asteroid ast_explode:(num%) sound_highBeep: ast_newStartPosition:(num%) REM increase kills kills%=kills%+1 IF kills%<=G_level_numKills%-G_level_numAsts% REM if more asteroids are necessary, reset this one ast_updateProperties:(num%,K_level_normAstSpeed*G_space_xDim&) ELSEIF kills%=G_level_numKills% REM level finished REM update the score G_game_score&=G_game_score&+K_game_levelBonus& REM and leave the level loop G_app_state%=K_app_stateInGame% ENDIF REM increase score G_game_score&=G_game_score&+G_ast_score&(num%) ENDIF ENDIF num%=num%+1 UNTIL num%>G_level_numAsts% DTDeleteDateTime:(astMoveTimeLast&) astMoveTimeLast&=DTNow&: ENDIF REM * print scores and energy * panel_check:(timeNow&) REM * Terminate playing sounds * sound_check:(timeNow&)  REM * EVENTHANDLING * IOYIELD REM No event => stat=-46 IF stat%<>-46 IF (thisEvent&(KEvAType%) AND KEvNotKeyMask&) = 0 REM the event is a key press IF thisEvent&(KEvAKMod%)=KKmodControl% REM CTRL is modifying the key: check for system commands IF cmd_checkSysKey%:(thisEvent&(1)+%a-1) panel_check:(timenow&) DTDeleteDateTime:(astMoveTimeLast&) astMoveTimeLast&=DTNow&: ENDIF ENDIF ELSEIF thisEvent&(KEvAType%)=KEvKeyDown& ANDthisEvent&(KEvAKMod%)=0 REM a key down event has been detected. IF thisEvent&(3)+32=G_app_key%(1) REM adding 32 makes upper->lower case base_updateShield:(1) ELSEIF thisEvent&(3)+32=G_app_key%(2) base_updateShield:(2) ELSEIF thisEvent&(3)+32=G_app_key%(3) base_updateShield:(3) ELSEIF thisEvent&(3)+32=G_app_key%(4) base_updateShield:(4) ENDIF  ELSEIF thisEvent&(KEvAType%)=KEvKeyUp& ANDthisEvent&(KEvAKMod%)=0 IF G_base_shield%>0 REM if the shield is on IF thisEvent&(3)+32=G_app_key%(G_base_shield%) REM and the shield's key is lifted, switch it off base_updateShield:(0) ENDIF ENDIF IF thisEvent&(3)=148 OR thisEvent&(3)=KKeySidebarMenu32% REM either the keyboard or silkscreen menu button has REM been pressed. menu_display: REM because processing the menu and subsequent REM operations may take some time, reset the timers. panel_check:(timenow&) DTDeleteDateTime:(astMoveTimeLast&) astMoveTimeLast&=DTNow&: ENDIF ELSEIF thisEvent&(KEvAType%)=KEvFocusLost& REM the application has moved to the background, REM so pause the game. cmd_pause:  ELSEIF thisEvent&(KEvAType%)=KEvCommand& REM the application receives a message from system. REM I'm not sure how this could happen, considering REM that the application pauses when in the background. REM Better to deal with it anyway. IF LEFT$(GETCMD$,1)=KGetCmdLetterExit$ REM the message is an "exit" message. cmd_exit: ENDIF  ENDIF IF G_app_state%>K_app_stateInLevel% pause_initialise: pause_loop: pause_close: IF G_app_state%=K_app_stateInLevel% G_app_interact%=KTrue% ENDIF ENDIF REM Request the next event GETEVENTA32 stat%,thisEvent&() ENDIF REM reset time structure DTDeleteDateTime:(timenow&) timenow&=DTNow&: UNTIL G_app_state%G_level_numAsts% base_delete: REM update the score now to avoid delay panel_update:ENDPPROC _level_astInitialise:(num%) EXTERNAL G_level_astDrawTimeLast&(),G_level_astTrav% EXTERNAL G_level_numAsts%,G_space_xDim& LOCAL small%,speed& small%=RND*2 IF small%=0 speed&=K_level_normAstSpeed*G_space_xDim&*1.12 ELSE speed&=K_level_normAstSpeed*G_space_xDim&*0.88 ENDIF ast_initialise:(num%,small%) ast_newStartPosition:(num%) ast_updateProperties:(num%,speed&) REM time interval until next time it is drawn G_level_astDrawTimeLast&(num%)=DTNow&:ENDPPROC _level_astCheck:(timenow&) EXTERNAL G_level_astDrawTimeLast&(),G_level_astTrav%,G_level_numAsts% IF DTMicrosDiff&:(G_level_astDrawTimeLast&(G_level_astTrav%),timenow&)>K_level_astDrawTimeDelay& REM G_level_astTrav% traverses the current asteroids ast_draw:(G_level_astTrav%) REM update time structures DTDeleteDateTime:(G_level_astDrawTimeLast&(G_level_astTrav%)) G_level_astDrawTimeLast&(G_level_astTrav%)=DTNow&: REM increment trav% to process next asteroid G_level_astTrav%=G_level_astTrav%+1 IF G_level_astTrav%>G_level_numAsts% G_level_astTrav%=1 ENDIF ENDIFENDPPROC _level_numAstsAt%:(level%) REM Returns the number of asteroids in this particular level. REM the pattern is 2,3,3,4,4,4,5,5,5,5,6,6,6,6,6,7 LOCAL number% REM solution of the quadratic equation: "n-3n+2(2-l)=0" number%=(3+SQR((8*level%)-7))/2 REM of course, we can only support a maximum number. IF number%>K_game_maxNumAsts% number%=K_game_maxNumAsts% ENDIF RETURN number%ENDPREM *********************REM **** ****REM **** Pause Stuff ****REM **** ****REM *********************PROC pause_initialise: EXTERNAL G_app_state%,G_app_interact% REM If state ius where it should be, return to interactive REM mode. IF G_app_state%=K_app_stateInPause% G_app_interact%=Ktrue% ENDIFENDPPROC pause_loop: EXTERNAL G_app_state% REM #### replace with event loop! LOCK ON dINIT "Paused" dBUTTONS "Play",KKeyEnter% DIALOG LOCK OFF REM leave pause G_app_state%=K_app_stateInLevel%ENDPPROC pause_close:ENDPREM *****************************REM **** ****REM **** BASE GRAPHICS STUFF ****REM **** ****REM *****************************PROC base_initialise: EXTERNAL G_base_x&,G_base_y& EXTERNAL G_space_xDim&,G_space_yDim& EXTERNAL G_base_size&,G_base_rot G_base_x&=(G_space_xDim&/2) G_base_y&=(G_space_yDim&/2) G_base_size&=K_base_initBaseSize*G_space_xDim& G_base_rot=K_level_normBaseRotENDPPROC base_draw: _base_drawBase:(Ktrue%)ENDPPROC base_delete: _base_drawBase:(Kfalse%)ENDPPROC base_updateShield:(shield%) EXTERNAL G_base_shield% REM only do if the shield has changed IF shield%<>G_base_shield% _base_drawShield:(Kfalse%) G_base_shield%=shield% IF shield%>0 _base_drawShield:(Ktrue%) ENDIF ENDIFENDPPROC base_rotateBase: EXTERNAL G_base_rot G_base_rot= 6.283*RNDENDPPROC base_growBase: EXTERNAL G_base_size&,G_space_xDim& G_base_size&=1.075*G_base_size& IF G_base_size&>K_base_maxBaseSize*G_space_xDim& G_base_size&=K_base_maxBaseSize*G_space_xDim& ENDIFENDPPROC base_moveBase:(dispFactor) EXTERNAL G_space_xDim&,G_space_yDim& EXTERNAL G_base_x&,G_base_y&,G_base_size& LOCAL curDispRange& curDispRange&=(G_space_xDim&-(K_base_maxBaseSize*G_space_xDim&*2.5))*dispFactor G_base_x&=(G_space_xDim&/2)+(curDispRange&*(RND-0.5)) G_base_y&=(G_space_yDim&/2)+(curDispRange&*(RND-0.5))ENDPPROC base_close: _base_drawBase:(Kfalse%)ENDPPROC _base_drawBase:(see%) EXTERNAL G_space_window%,G_base_shield% EXTERNAL G_base_x&,G_base_y& EXTERNAL G_base_size&,G_base_rot LOCAL size&,shield% gUSE G_space_window% REM draw/delete inner and outer squares  IF see% _base_setGrey:(1) ELSE _base_setGrey:(3) ENDIF _base_drawSquare:(K_factor&,G_base_x&,G_base_y&,G_base_size&*K_base_borderFactor,G_base_rot) IF see% _base_setGrey:(0) ELSE _base_setGrey:(3) ENDIF _base_drawSquare:(K_factor&,G_base_x&,G_base_y&,G_base_size&,G_base_rot) REM draw shield IF G_base_shield%<>0 _base_drawShield:(see%) ENDIF REM draw labels _base_drawLabels:(see%)ENDPPROC _base_drawShield:(see%) EXTERNAL G_space_window%,G_base_shield% EXTERNAL G_base_x&,G_base_y& EXTERNAL G_base_size&,G_base_rot,G_space_xDim& LOCAL size& gUSE G_space_window% IF see% _base_setGrey:(0) ELSE _base_setGrey:(3) ENDIF REM to force this value to be a long and not a floating point size&=G_base_size&+(K_base_shieldFactor*G_space_xDim&) _base_drawEdge:(K_factor&,G_base_x&,G_base_y&,size&,G_base_rot,G_base_shield%)ENDPPROC _base_drawLabels:(see%) EXTERNAL G_base_size&,G_base_rot,G_base_x&,G_base_y&,G_app_key%() LOCAL l1&,l2&,x&(4),y&(4) REM find coordinates l1&=((G_base_size&*K_base_borderFactor)*COS(G_base_rot)*66)/100 l2&=((G_base_size&*K_base_borderFactor)*SIN(G_base_rot)*66)/100 x&(1)=G_base_x&+(l2&-l1&)/2+K_base_labelXOffset& y&(1)=G_base_y&-(l2&+l1&)/2+K_base_labelYOffset& x&(2)=G_base_x&+(l1&+l2&)/2+K_base_labelXOffset& y&(2)=G_base_y&+(l2&-l1&)/2+K_base_labelYOffset& x&(3)=G_base_x&+(l1&-l2&)/2+K_base_labelXOffset& y&(3)=G_base_y&+(l1&+l2&)/2+K_base_labelYOffset& x&(4)=G_base_x&-(l1&+l2&)/2+K_base_labelXOffset& y&(4)=G_base_y&+(l1&-l2&)/2+K_base_labelYOffset&  REM draw labels IF see% _base_setGrey:(0) ELSE _base_setGrey:(3) ENDIF gFONT KFontArialNormal15& gAT x&(1)/K_factor&,y&(1)/K_factor& gPRINT CHR$(G_app_key%(1)) gAT x&(2)/K_factor&,y&(2)/K_factor& gPRINT CHR$(G_app_key%(2)) gAT x&(3)/K_factor&,y&(3)/K_factor& gPRINT CHR$(G_app_key%(3)) gAT x&(4)/K_factor&,y&(4)/K_factor& gPRINT CHR$(G_app_key%(4))ENDPPROC _base_drawSquare:(factor&,x&,y&,size&,rot) REM This is inefficient since each corner is calculated twice. REM As it's only done once at level start, I don't care. _base_drawEdge:(factor&,x&,y&,size&,rot,1) _base_drawEdge:(factor&,x&,y&,size&,rot,2) _base_drawEdge:(factor&,x&,y&,size&,rot,3) _base_drawEdge:(factor&,x&,y&,size&,rot,4)ENDPPROC _base_drawEdge:(factor&,x&,y&,size&,rot,edge%) REM * Draw a specific edge of a square with given position,* REM * size, rotation and grey. Lengths are w.r.t. to a * REM * given factor. * LOCAL l1&,l2&,x&(2),y&(2) REM offsets l1&=size&*COS(rot) l2&=size&*SIN(rot) REM which edge? IF edge%=1 x&(1)=x&-l1& y&(1)=y&-l2& x&(2)=x&+l2& y&(2)=y&-l1& ELSEIF edge%=2 x&(1)=x&+l2& y&(1)=y&-l1& x&(2)=x&+l1& y&(2)=y&+l2& ELSEIF edge%=3 x&(1)=x&+l1& y&(1)=y&+l2& x&(2)=x&-l2& y&(2)=y&+l1& ELSE x&(1)=x&-l2& y&(1)=y&+l1& x&(2)=x&-l1& y&(2)=y&-l2& ENDIF REM draw line gAT x&(1)/factor&,y&(1)/factor& gLINETO x&(2)/factor&,y&(2)/factor&ENDPPROC _base_setGrey:(grey%) IF grey%=3 gCOLOR 255,255,255 ELSEIF grey%=2 gCOLOR 170,170,170 ELSEIF grey%=1 gCOLOR 85,85,85 ELSE gCOLOR 0,0,0 ENDIFENDPREM **********************REM **** ****REM **** Screen Stuff ****REM **** ****REM **********************PROC screen_initialise: EXTERNAL G_screen_xDim%,G_screen_yDim%,G_bm_screenBG% REM return values from _screen_arrange:() GLOBAL R_space_xDim%,R_space_yDim% GLOBAL R_space_xPos%,R_space_yPos% GLOBAL R_title_xDim%,R_title_yDim% GLOBAL R_title_xPos%,R_title_yPos% GLOBAL R_panel_xDim%,R_panel_yDim% GLOBAL R_panel_xPos%,R_panel_yPos% gUSE KDefaultWin% REM if we are testing, we should already have screen details REM assigned. IF NOT T_test% REM to find the screen size, find the height and width of REM the default window. G_screen_xDim%=gWIDTH G_screen_yDim%=gHEIGHT ENDIF gPATT G_bm_screenBG%,G_screen_xDim%,G_screen_yDim%,0 gXBORDER 2,$01 _screen_arrange:(G_screen_xDim%,G_screen_yDim%) space_initialise:(R_space_xPos%,R_space_yPos%,R_space_xDim%,R_space_yDim%) title_initialise:(R_title_xPos%,R_title_yPos%,R_title_xDim%,R_title_yDim%) panel_initialise:(R_panel_xPos%,R_panel_yPos%,R_panel_xDim%,R_panel_yDim%)ENDPPROC screen_close: panel_close: title_close: space_close:ENDPPROC _screen_arrange:(screen_xDim%,screen_yDim%) EXTERNAL R_space_xDim%,R_space_yDim% EXTERNAL R_space_xPos%,R_space_yPos% EXTERNAL R_title_xDim%,R_title_yDim% EXTERNAL R_title_xPos%,R_title_yPos% EXTERNAL R_panel_xDim%,R_panel_yDim% EXTERNAL R_panel_xPos%,R_panel_yPos% LOCAL xPad%,yPad%,xRoom%,yRoom%,spaceSize% R_panel_xDim%=K_panel_xDim% R_title_xDim%=K_title_xDim% xRoom%=screen_xDim%-(R_title_xDim%+R_panel_xDim%) yRoom%=screen_yDim% IF xRoom%>K_space_minSize% REM the screen has room for side-by-side windows IFxRoom%K_space_maxSize% spaceSize%=K_space_maxSize% ENDIF R_space_xDim%=spaceSize% R_space_yDim%=spaceSize% R_panel_yDim%=K_panel_yDimBig% R_title_yDim%=K_title_yDimBig% xPad%=(screen_xDim%-R_panel_xDim%-spaceSize%-R_title_xDim%)/4 R_panel_xPos%=xPad% R_panel_yPos%=(screen_yDim%-R_panel_yDim%)/2 R_space_xPos%=xPad%+R_panel_xDim%+xPad% R_space_yPos%=(screen_yDim%-R_space_yDim%)/2 R_title_xPos%=xPad%+K_panel_xDim%+xPad%+R_space_xDim%+xPad% R_title_yPos%=(screen_yDim%-R_title_yDim%)/2 ELSEIF yRoom%>=K_space_minSize% REM currently only the Osaris REM assume panel and title windows have same width xRoom%=screen_xDim%-R_title_xDim% IFxRoom%K_space_maxSize% spaceSize%=K_space_maxSize% ENDIF R_space_xDim%=spaceSize% R_space_yDim%=spaceSize% R_panel_yDim%=screen_yDim%/2-(((screen_yDim%/2)-K_panel_yDimSmall%)*0.40) R_title_yDim%=R_panel_yDim% xPad%=(screen_xDim%-R_title_xDim%-spaceSize%)/3 yPad%=(screen_yDim%-R_panel_yDim%-R_title_yDim%)/3 R_space_xPos%=xPad%+K_title_xDim%+xPad% R_space_yPos%=(screen_yDim%-R_space_yDim%)/2 R_title_xPos%=xPad% R_title_yPos%=yPad% R_panel_xPos%=xPad% R_panel_yPos%=yPad%+R_title_yDim%+yPad% ELSE REM The screen isn't wide enough _screen_sizeNotSupported: ENDIFENDPPROC _screen_sizeNotSupported: EXTERNAL G_app_state% REM #### this needs to be handled properly LOCK ON dINIT "Sorry!" dTEXT "","Your machine's screen size",2 dTEXT "","is not supported (yet).",2 dBUTTONS "Okay",KKeyEnter% DIALOG LOCK OFF G_app_state%=K_app_stateLeaveApp%ENDPREM ****************************REM **** ****REM **** Space Window Stuff ****REM **** ****REM ****************************PROC space_initialise:(xPos%,yPos%,xDim%,yDim%) _space_build:(xPos%,yPos%,xDim%,yDim%)ENDPPROC space_close: EXTERNAL G_space_window% gCLOSE G_space_window%ENDPPROC _space_build:(xPos%,yPos%,xDim%,yDim%) EXTERNAL G_space_window% EXTERNAL G_space_xDim&,G_space_yDim& G_space_window% = gCREATE(xPos%,yPos%,xDim%,yDim%,1,1) gXBORDER 2,$01 G_space_xDim&=xDim%*K_factor& G_space_yDim&=yDim%*K_factor&ENDPREM ****************************REM **** ****REM **** Title Window Stuff ****REM **** ****REM ****************************PROC title_initialise:(xPos%,yPos%,xDim%,yDim%) _title_build:(xPos%,yPos%,xDim%,yDim%)ENDPPROC title_close: EXTERNAL G_title_window% gCLOSE G_title_window%ENDPPROC _title_build:(xPos%,yPos%,xDim%,yDim%) EXTERNAL G_title_window% EXTERNAL G_bm_titleMr%,G_bm_titleMeteoroid%,G_bm_titleGame% LOCAL xMrSize%,yMrSize%,xMeteoroidSize%,yMeteoroidSize% LOCAL xGameSize%,yGameSize%,yPad% REM Because the title bitmaps are drawables, we can use gWIDTH REM and gHEIGHT to get their dimentions gUSE G_bm_titleMr% xMrSize%=gWIDTH yMrSize%=gHEIGHT gUSE G_bm_titleMeteoroid% xMeteoroidSize%=gWIDTH yMeteoroidSize%=gHEIGHT gUSE G_bm_titleGame% xGameSize%=gWIDTH yGameSize%=gHEIGHT yPad%=(yDim%-yMrSize%-yMeteoroidSize%-yGameSize%)/4 G_title_window%=gCREATE(xPos%,yPos%,xDim%,yDim%,1,1) gXBORDER 2,$01 gAT (xDim%-xMrSize%)/2,yPad% gCOPY G_bm_titleMr%,0,0,xMrSize%,yMrSize%,3 gAT (xDim%-xMeteoroidSize%)/2,yPad%+yMrSize%+yPad% gCOPY G_bm_titleMeteoroid%,0,0,xMeteoroidSize%,yMeteoroidSize%,3 gAT (xDim%-xGameSize%)/2,yPad%+yMrSize%+yPad%+yMeteoroidSize%+yPad% gCOPY G_bm_titleGame%,0,0,xGameSize%,yGameSize%,3 ENDPREM ************************REM **** ****REM **** Panel graphics ****REM **** ****REM ************************PROC panel_initialise:(xPos%,yPos%,xDim%,yDim%) EXTERNAL G_panel_timeLast&,G_panel_score&,G_panel_energy% REM load the pc_bar OPM REM #### commented out until symbian release final versions REM OPM_LoadModule:("pc_bar") LOADM("Pc_bar.opm") _panel_build:(xPos%,yPos%,xDim%,yDim%) G_panel_score&=0 G_panel_energy%=K_game_initEnergy% _panel_printScore: _panel_printEnergy: REM initialise the date time structure G_panel_timeLast&=DTNow&:ENDPPROC panel_check:(timenow&) EXTERNAL G_panel_timeLast& REM if a sufficient time interval has passed IF DTMicrosDiff&:(G_panel_timeLast&,timenow&)>K_panel_timeDelay& panel_update: ENDIFENDPPROC panel_update: EXTERNAL G_game_score&,G_panel_score& EXTERNAL G_game_energy%,G_panel_energy% EXTERNAL G_panel_timeLast& REM If the score has changed IF G_game_score&<>G_panel_score& G_panel_score&=G_game_score& _panel_printScore: ENDIF REM if the energy has changed IF G_game_energy%<>G_panel_energy% IF G_game_energy%>=0 G_panel_energy%=G_game_energy% ELSE G_panel_energy%=0 ENDIF _panel_printEnergy: ENDIF REM reset the timer DTDeleteDateTime:(G_panel_timeLast&) G_panel_timeLast&=DTNow&:ENDPPROC panel_close: EXTERNAL G_panel_energyBar&,G_panel_window% EXTERNAL G_panel_timeLast& pc_destroy_freebar:(G_panel_energyBar&) REM unload the PC_bar OPM OPM_UnLoadModule:("pc_bar") REM remove the window gCLOSE G_panel_window% REM delete the time structure DTDeleteDateTime:(G_panel_timeLast&)ENDPPROC _panel_build:(xPos%,yPos%,xDim%,yDim%) EXTERNAL G_panel_window%,G_panel_energyBar& EXTERNAL G_bm_panelScore%,G_bm_panelEnergy% EXTERNAL G_panel_scoreYPos%, G_panel_scoreWidth% LOCAL xScoreSize%,yScoreSize%,xEnergySize%,yEnergySize% LOCAL yPad%  REM Because the energy and score bitmaps are drawables, we REM can use gWIDTH and gHEIGHT to get their dimentions. gUSE G_bm_panelScore% xScoreSize%=gWIDTH yScoreSize%=gHEIGHT gUSE G_bm_panelEnergy% xEnergySize%=gWIDTH yEnergySize%=gHEIGHT G_panel_window%=gCREATE(xPos%,yPos%,xDim%,yDim%,1,1) gXBORDER 2,$01 yPad%=(yDim%-yScoreSize%-K_panel_scoreFontHeight%-yEnergySize%-yScoreSize%)/5 gAT (xDim%-xScoreSize%)/2,yPad% gCOPY G_bm_panelScore%,0,0,xScoreSize%,yScoreSize%,3 G_panel_scoreYPos%=yPad%+yScoreSize%+yPad%+K_panel_scoreFontHeight%-1 G_panel_scoreWidth%=xDim%-20 gAT (xDim%-xEnergySize%)/2,yPad%+yScoreSize%+yPad%+K_panel_scoreFontHeight%+yPad% gCOPY G_bm_panelEnergy%,0,0,xEnergySize%,yEnergySize%,3 G_panel_energyBar&=pc_freebar&:(G_panel_window%,10,yDim%-yPad%,G_panel_scoreWidth%,yScoreSize%,KPcBarHorizontal%,KPcBarTextNone%,KPcBarColourBlack&,KPcBarColourWhite&,K_game_initEnergy%)ENDPPROC _panel_printScore: EXTERNAL G_panel_score&,G_panel_window% EXTERNAL G_panel_scoreYPos%,G_panel_scoreWidth% gUSE G_panel_window% gCOLOR 0,0,0 gFONT K_panel_scoreFont& gAT 10,G_panel_scoreYPos% gPRINTB misc_padWithZeroes$:(K_hs_numDigits%,G_panel_score&),G_panel_scoreWidth%,3,2ENDPPROC _panel_printEnergy: EXTERNAL G_panel_energyBar&,G_panel_energy% pc_bar_update%:(G_panel_energyBar&,G_panel_energy%)ENDPREM *********************************REM **** ****REM **** Asteroid Graphics Stuff ****REM **** ****REM *********************************PROC ast_initialise:(num%,size%) EXTERNAL G_ast_sprite&(),G_ast_r&(),G_ast_dx&(),G_ast_dy&() EXTERNAL G_ast_score&(),G_ast_damage%() EXTERNAL G_bm_smallAstXDim%,G_bm_bigAstXDim% IF size%=0 G_ast_sprite&(num%)=_ast_createSmallAst&: G_ast_r&(num%)=(G_bm_smallAstXDim%/2)*K_factor& G_ast_score&(num%)=K_ast_SmallScore& G_ast_damage%(num%)=K_ast_smallDamage% G_ast_dx&(num%)=0 G_ast_dy&(num%)=0 ELSEIF size%=1 G_ast_sprite&(num%)=_ast_createBigAst&: G_ast_r&(num%)=(G_bm_bigAstXDim%/2)*K_factor& G_ast_score&(num%)=K_ast_bigScore& G_ast_damage%(num%)=K_ast_bigDamage% G_ast_dx&(num%)=0 G_ast_dy&(num%)=0 ENDIFENDPPROC ast_draw:(num%) EXTERNAL G_ast_sprite&(),G_ast_x&(),G_ast_y&(),G_ast_r&() SPRITEUSE:(G_ast_sprite&(num%)) SPRITEPOS:((G_ast_x&(num%)-G_ast_r&(num%))/K_factor&,(G_ast_y&(num%)-G_ast_r&(num%))/K_factor&)ENDPPROC ast_explode:(num%) EXTERNAL G_ast_dx&(),G_ast_dy&() REM Unfortunately no visual explosion effects! REM Just draw it in its final position ast_draw:(num%) REM and stop it from moving G_ast_dx&(num%)=0 G_ast_dy&(num%)=0ENDPPROC ast_newStartPosition:(num%) EXTERNAL G_ast_x&(),G_ast_y&(),G_ast_r&() EXTERNAL G_space_xDim&,G_space_yDim& LOCAL random random=RND IF random < 0.25 G_ast_x&(num%)=(RND*(G_space_xDim&+(G_ast_r&(num%)*2)))-G_ast_r&(num%) G_ast_y&(num%)=-G_ast_r&(num%)-500 ELSEIF random < 0.5 G_ast_x&(num%)=-G_ast_r&(num%)-500 G_ast_y&(num%)=(RND*(G_space_yDim&+(G_ast_r&(num%)*2)))-G_ast_r&(num%) ELSEIF random < 0.75 G_ast_x&(num%)=(RND*(G_space_xDim&+(G_ast_r&(num%)*2)))-G_ast_r&(num%) G_ast_y&(num%)=G_space_yDim&+G_ast_r&(num%)+500 ELSE G_ast_x&(num%)=G_space_xDim&+G_ast_r&(num%)+500 G_ast_y&(num%)=(RND*(G_space_yDim&+(G_ast_r&(num%)*2)))-G_ast_r&(num%) ENDIFENDPPROC ast_updateProperties:(num%,speed&) EXTERNAL G_base_x&,G_base_y&,G_base_rot,G_base_size& EXTERNAL G_ast_x&(),G_ast_y&(),G_ast_r&(),G_ast_dx&(),G_ast_dy&() EXTERNAL G_ast_side%(),G_ast_distToBase&() EXTERNAL G_ast_distToShield&(),G_space_xDim& LOCAL beta&,theta&,q1%,alpha,alpha&,qa%,side%,phi&,l&,h1&,h2&,rho1&,rho2& REM WARNING: This is all based on paper calculations I've lost. REM Look inside at your peril!  REM These calculations have to be performed in the middle of REM a level. Therefore they have to be reasonably quick. REM Notice that I use longs rather than floats for angles, REM this is for speed.  REM * STEP 1 * REM find theta and q1 theta&=G_base_rot*100000000 q1%=1 WHILE theta&>157079633 theta&=theta&-157079633 q1%=q1%+1 ENDWH REM * STEP 2 * REM find dx, dy, alpha and qa IF G_ast_x&(num%)>G_base_x& IF G_ast_y&(num%)>G_base_y& REM quadrant 3 qa%=3 alpha=ATAN((G_ast_y&(num%)-G_base_y&)/(1.0*G_ast_x&(num%)-G_base_x&)) REM set deltas G_ast_dx&(num%)=-(speed&*COS(alpha)) G_ast_dy&(num%)=-(speed&*SIN(alpha)) ELSE REM quadrant 2 qa%=2 alpha=ATAN((G_ast_x&(num%)-G_base_x&)/(1.0*G_base_y&-G_ast_y&(num%))) REM set deltas G_ast_dx&(num%)=-(speed&*SIN(alpha)) G_ast_dy&(num%)=(speed&*COS(alpha)) ENDIF ELSE IF G_ast_y&(num%)>G_base_y& REM quadrant 4 qa%=4 alpha=ATAN((G_base_x&-G_ast_x&(num%))/(1.0*G_ast_y&(num%)-G_base_y&)) REM set deltas G_ast_dx&(num%)=(speed&*SIN(alpha)) G_ast_dy&(num%)=-(speed&*COS(alpha)) ELSE REM quadrant 1 qa%=1 alpha=ATAN((G_base_y&-G_ast_y&(num%))/(1.0*G_base_x&-G_ast_x&(num%))) REM set deltas G_ast_dx&(num%)=(speed&*COS(alpha)) G_ast_dy&(num%)=(speed&*SIN(alpha)) ENDIF  ENDIF alpha&=alpha*100000000 REM * STEP 3 * REM calculate phi REM 78539816 REM 157079633 REM 314159265 REM this tolerence comes from play-testing IF ABS(theta&-alpha&)<17000000 REM * Asteroid will hit a CORNER * REM actually an approximation REM find side*s* side%=qa%-q1%-1 REM the side anticlockwise from the asteroid IF side%<0 side%=4+side% ENDIF G_ast_side%(num%)=2**side% REM the side clockwise from the asteroid side%=side%+1 IF side%=4 side%=0 ENDIF G_ast_side%(num%)=G_ast_side%(num%)+2**side% REM distances REM these are values only apply if alpha=theta REM but use them as approximations anyway. Subtract 5 to REM reduce the obviousness. G_ast_distToBase&(num%)=((G_base_size&+G_ast_r&(num%))/K_factor&)-5 G_ast_distToShield&(num%)=((G_base_size&+K_base_shieldFactor*G_space_xDim&+G_ast_r&(num%))/K_factor&)-5 G_ast_distToBase&(num%)=G_ast_distToBase&(num%)**2 G_ast_distToShield&(num%)=G_ast_distToShield&(num%)**2 ELSE REM * Asteroid will hit a SIDE * REM find side side%=qa%-q1% IF alpha&rho2& phi&=157079633+rho2&-alpha& ELSEIF alpha&>theta& phi&=alpha&-rho1& ELSEIF alpha&>rho1& phi&=rho2&-alpha& ELSE phi&=314159265+alpha&-rho2& ENDIF l&=G_base_size&*0.7072 h1&=(l&+G_ast_r&(num%))/K_factor& h2&=(l&+K_base_shieldFactor*G_space_xDim&+G_ast_r&(num%))/K_factor& G_ast_distToBase&(num%)=h1&/(SIN(phi&/100000000.0)) G_ast_distToShield&(num%)=h2&/(SIN(phi&/100000000.0)) G_ast_distToBase&(num%)=G_ast_distToBase&(num%)**2 G_ast_distToShield&(num%)=G_ast_distToShield&(num%)**2 ENDIFENDPPROC ast_close:(num%) EXTERNAL G_ast_sprite&() SPRITEDELETE:(G_ast_sprite&(num%))ENDPPROC _ast_createSmallAst&: EXTERNAL G_space_window%,G_bm_smallAst&,G_bm_smallAstMask& EXTERNAL G_bm_smallAstXDim% LOCAL handle& handle&=SPRITECREATE&:(G_space_window%,-G_bm_smallAstXDim%-5,0,0) SPRITEAPPEND:(0,G_bm_smallAst&,G_bm_smallAstMask&,1,0,0) SPRITEDRAW: RETURN handle&ENDPPROC _ast_createBigAst&: EXTERNAL G_space_window%,G_bm_bigAst&,G_bm_bigAstMask& EXTERNAL G_bm_bigAstXDim% LOCAL handle& handle&=SPRITECREATE&:(G_space_window%,-G_bm_bigAstXDim%-5,0,0) SPRITEAPPEND:(0,G_bm_bigAst&,G_bm_bigAstMask&,1,0,0) SPRITEDRAW: RETURN handle&ENDPREM *************************REM **** ****REM **** .ini File Stuff ****REM **** ****REM *************************PROC init_initialise: REM load the INI OPM module for .ini stuff here REM #### Commented out until symbian release final versions of the opms REM OPM_LoadModule:("ini") LOADM("ini.opm") REM Make sure that the directory C:\system\apps\meteoroid\ REM exists, as this is used for the .ini file. IF NOT EXIST(K_init_drive$+K_init_path$+K_app_fileBase$) MKDIR K_init_drive$+K_init_path$+K_app_fileBase$ ENDIF REM make sure user can't interrupt while the .ini file is in REM use. ESCAPEOFF REM check for .ini file IF INI_Open%:(K_init_drive$+K_init_path$+K_app_fileBase$+"\"+K_app_fileBase$+K_init_extension$)=-1 REM #### unable to open .ini file, do something! ENDIF _init_readInits: REM No point in leaving file open, as it won't get used REM again until app closure INI_Close:(K_init_drive$+K_init_path$+K_app_fileBase$+"\"+K_app_fileBase$+K_init_extension$) ESCAPE ONENDPPROC init_useDefaults: REM Set preferences to the "hard-coded" constants. EXTERNAL G_app_key%(),G_sound_on%,G_sound_volume% G_app_key%(1)=D_app_initKey1% G_app_key%(2)=D_app_initKey2% G_app_key%(3)=D_app_initKey3% G_app_key%(4)=D_app_initKey4% G_sound_on%=D_sound_on% G_sound_volume%=D_sound_volume%ENDPPROC init_close: REM make sure user can't interrupt while the .ini file is in REM use. ESCAPE OFF REM save preferences and high scores to .ini file and close it IF INI_Open%:(K_init_drive$+K_init_path$+K_app_fileBase$+"\"+K_app_fileBase$+K_init_extension$)=-1 REM #### unable to open .ini file, do something! ENDIF _init_writeInits: INI_Close:(K_init_drive$+K_init_path$+K_app_fileBase$+"\"+K_app_fileBase$+K_init_extension$) ESCAPE ON REM unload the INI OPM OPM_UnLoadModule:("ini")ENDPPROC _init_readInits: EXTERNAL G_app_key%(),G_hs_name$(),G_hs_score&() EXTERNAL G_sound_on%,G_sound_volume% REM load initial values. REM if no values are found, use the defaults  G_app_key%(1)=INI_Read%:("key1",D_app_initKey1%) G_app_key%(2)=INI_Read%:("key2",D_app_initKey2%) G_app_key%(3)=INI_Read%:("key3",D_app_initKey3%) G_app_key%(4)=INI_Read%:("key4",D_app_initKey4%) G_sound_on%=INI_Read%:("sound",D_sound_on%) G_sound_volume%=INI_Read%:("volume",D_sound_volume%) G_hs_name$(1)=INI_Read$:("name1",D_hs_name1$) G_hs_name$(2)=INI_Read$:("name2",D_hs_name2$) G_hs_name$(3)=INI_Read$:("name3",D_hs_name3$) G_hs_name$(4)=INI_Read$:("name4",D_hs_name4$) G_hs_name$(5)=INI_Read$:("name5",D_hs_name5$) G_hs_score&(1)=INI_Read&:("score1",D_hs_score1&) G_hs_score&(2)=INI_Read&:("score2",D_hs_score2&) G_hs_score&(3)=INI_Read&:("score3",D_hs_score3&) G_hs_score&(4)=INI_Read&:("score4",D_hs_score4&) G_hs_score&(5)=INI_Read&:("score5",D_hs_score5&)ENDPPROC _init_writeInits: EXTERNAL G_app_key%(),G_hs_name$(),G_hs_score&() EXTERNAL G_sound_on%,G_sound_volume% REM write preferences to .ini file INI_Write%:("key1",G_app_key%(1)) INI_Write%:("key2",G_app_key%(2)) INI_Write%:("key3",G_app_key%(3)) INI_Write%:("key4",G_app_key%(4)) INI_Write%:("sound",G_sound_on%) INI_Write%:("volume",G_sound_volume%) INI_Write$:("name1",G_hs_name$(1)) INI_Write$:("name2",G_hs_name$(2)) INI_Write$:("name3",G_hs_name$(3)) INI_Write$:("name4",G_hs_name$(4)) INI_Write$:("name5",G_hs_name$(5)) INI_Write&:("score1",G_hs_score&(1)) INI_Write&:("score2",G_hs_score&(2)) INI_Write&:("score3",G_hs_score&(3)) INI_Write&:("score4",G_hs_score&(4)) INI_Write&:("score5",G_hs_score&(5))ENDPREM **********************REM **** ****REM **** Bitmap Stuff ****REM **** ****REM **********************PROC bm_initialise: REM these are grouped here in order to make a single access REM on the bitmap files EXTERNAL G_app_drive$,G_app_path$ EXTERNAL G_bm_bigAst&,G_bm_bigAstMask& EXTERNAL G_bm_smallAst&,G_bm_smallAstMask& EXTERNAL G_bm_smallAstXDim%,G_bm_bigAstXDim% EXTERNAL G_bm_titleMr%,G_bm_titleMeteoroid%,G_bm_titleGame% EXTERNAL G_bm_panelEnergy%,G_bm_panelScore% EXTERNAL G_bm_screenBG%  LOCAL temp% REM This is an ugly way to find the width of the asteroids: REM Load them into a drawable and find *its* width! REM But it's the only way I can think of temp%=gLOADBIT(G_app_drive$+G_app_path$+K_app_fileBase$+"\"+K_app_fileBase$+K_bm_extension$,0,K_bm_bigAstIndex%) G_bm_bigAstXDim%=gWIDTH gCLOSE temp% temp%=gLOADBIT(G_app_drive$+G_app_path$+K_app_fileBase$+"\"+K_app_fileBase$+K_bm_extension$,0,K_bm_smallAstIndex%) G_bm_smallAstXDim%=gWIDTH gCLOSE temp% REM Patterns REM the background pattern for the screen window. REM This is used in a bitmap drawable, so use gLOADBIT() G_bm_screenBG%=gLOADBIT(G_app_drive$+G_app_path$+K_app_fileBase$+"\"+K_app_fileBase$+K_bm_extension$,0,K_bm_screenBGIndex%) REM Prerendered Text REM These are used in bitmap drawables, so use gLOADBIT() G_bm_titleMr%=gLOADBIT(G_app_drive$+G_app_path$+K_app_fileBase$+"\"+K_app_fileBase$+K_bm_extension$,0,K_bm_titleMrIndex%) G_bm_titleMeteoroid%=gLOADBIT(G_app_drive$+G_app_path$+K_app_fileBase$+"\"+K_app_fileBase$+K_bm_extension$,0,K_bm_titleMeteoroidIndex%) G_bm_titleGame%=gLOADBIT(G_app_drive$+G_app_path$+K_app_fileBase$+"\"+K_app_fileBase$+K_bm_extension$,0,K_bm_titleGameIndex%) G_bm_panelScore%=gLOADBIT(G_app_drive$+G_app_path$+K_app_fileBase$+"\"+K_app_fileBase$+K_bm_extension$,0,K_bm_panelScoreIndex%) G_bm_panelEnergy%=gLOADBIT(G_app_drive$+G_app_path$+K_app_fileBase$+"\"+K_app_fileBase$+K_bm_extension$,0,K_bm_panelEnergyIndex%) REM The Asteroids REM these are used in sprites, so use BITMAPLOAD&:() G_bm_bigAst&=BITMAPLOAD&:(G_app_drive$+G_app_path$+K_app_fileBase$+"\"+K_app_fileBase$+K_bm_extension$,K_bm_bigAstIndex%) G_bm_bigAstMask&=BITMAPLOAD&:(G_app_drive$+G_app_path$+K_app_fileBase$+"\"+K_app_fileBase$+K_bm_extension$,K_bm_bigAstMaskIndex%) G_bm_smallAst&=BITMAPLOAD&:(G_app_drive$+G_app_path$+K_app_fileBase$+"\"+K_app_fileBase$+K_bm_extension$,K_bm_smallAstIndex%) G_bm_smallAstMask&=BITMAPLOAD&:(G_app_drive$+G_app_path$+K_app_fileBase$+"\"+K_app_fileBase$+K_bm_extension$,K_bm_smallAstMaskIndex%)ENDPPROC bm_close: EXTERNAL G_bm_bigAst&,G_bm_bigAstMask& EXTERNAL G_bm_smallAst&,G_bm_smallAstMask& EXTERNAL G_bm_screenBG% EXTERNAL G_bm_panelEnergy%,G_bm_panelScore% EXTERNAL G_bm_titleMr%,G_bm_titleMeteoroid%,G_bm_titleGame% BITMAPUNLOAD:(G_bm_bigAst&) BITMAPUNLOAD:(G_bm_bigAstMask&) BITMAPUNLOAD:(G_bm_smallAst&) BITMAPUNLOAD:(G_bm_smallAstMask&) gCLOSE G_bm_titleMr% gCLOSE G_bm_titleMeteoroid% gCLOSE G_bm_titleGame% gCLOSE G_bm_screenBG% gCLOSE G_bm_panelEnergy% gCLOSE G_bm_panelScore%ENDPREM **************REM **** ****REM **** Menu****REM **** ****REM **************PROC menu_display: EXTERNAL G_app_state% LOCAL choice%,inGame% IF G_app_state%=K_app_stateInGame% IF misc_confirm%:(K_app_name$,"Leave current game?") cmd_restart: ENDIF ELSE cmd_restart: ENDIF  ELSEIF key&=%p cmd_pause: RETURN KTrue% ELSEIF key&=%e IF G_app_state%0 REM If we have already opened a help file, try to use it ONERR noHelpThread:: SETFOREGROUNDBYTHREAD&:(G_help_thread&,0) ELSE noHelpThread:: ONERR OFF REM if we haven't, or if it's been closed, open a new one. G_help_thread&=RUNAPP&:("Data",G_app_drive$+G_app_path$+K_app_fileBase$+"\"+K_app_fileBase$+K_help_extension$,"",0) ENDIF ELSE REM if there is no helpfile, discretely inform the user. gIPRINT "No helpfile found!" ENDIFENDPPROC help_close: EXTERNAL G_help_thread& IF G_help_thread&<>0 REM if a help file has been opened, try to close it. ONERR noHelpThread:: ENDTASK&:(G_help_thread&,0) ENDIF REM if it's already been closed, continue without caring. noHelpThread:: ONERR OFFENDPREM *********************REM **** ****REM **** Preferences ****REM **** ****REM *********************PROC pref_change_keys: EXTERNAL G_app_key%(),G_app_state% LOCAL choice% LOCAL key_1$(1),key_2$(1),key_3$(1),key_4$(1) REM initialise edit boxes to current values key_1$=CHR$(G_app_key%(1)) key_2$=CHR$(G_app_key%(2)) key_3$=CHR$(G_app_key%(3)) key_4$=CHR$(G_app_key%(4)) LOCK ON dINIT "Change Keys" dEDIT key_1$,"Shield 1" dEDIT key_2$,"Shield 2" dEDIT key_3$,"Shield 3" dEDIT key_4$,"Shield 4" dBUTTONS "Cancel",-27,"Okay",13 choice%=DIALOG LOCK OFF IF choice%=13 IF G_app_state%>=K_app_stateInGame% REM If we're in a game, update the old graphics base_delete: ENDIF REM #### check for consistancy G_app_key%(1)=ASC(key_1$) G_app_key%(2)=ASC(key_2$) G_app_key%(3)=ASC(key_3$) G_app_key%(4)=ASC(key_4$) IF G_app_state%>=K_app_stateInGame% REM If we're in a game, draw new graphics base_draw: ENDIF ENDIFENDPPROC pref_restore_defaults: EXTERNAL G_app_state% IF misc_confirm%:("Restore Defaults","Are you sure?") IF G_app_state%>=K_app_stateInGame% REM If we're in a game, delete old base graphics base_delete: ENDIF  REM note that this doesn't affect the high scores init_useDefaults: IF G_app_state%>=K_app_stateInGame% REM If we're in a game, draw new base graphics base_draw: ENDIF ENDIFENDPREM ***************REM **** ****REM **** About ****REM **** ****REM ***************PROC about_display: LOCK ON dINIT "About "+K_app_name$ dTEXT "",K_app_name$+" "+K_app_version$,2 dTEXT "","2000 Malcolm Tyrrell",2 dTEXT "","This program is freeware.",2 dBUTTONS "Okay",KKeyEnter% DIALOG LOCK OFFENDPREM ******************REM **** ****REM **** HiScores ****REM **** ****REM ******************PROC hs_display: EXTERNAL G_hs_score&(),G_hs_name$() LOCAL i% REM #### I'm worried that this dialog won't fit on smaller screens. LOCK ON dINIT "High Scores" i%=1 DO dTEXT misc_padWithZeroes$:(K_hs_numdigits%,G_hs_score&(i%)),G_hs_name$(i%),2 i%=i%+1 UNTIL i%>K_hs_tableSize% dBUTTONS "Okay",KKeyEnter% DIALOG LOCK OFFENDPPROC hs_gameover%:(score&) EXTERNAL G_hs_score&(),G_hs_name$() LOCAL i%,pos%  REM display game over dialog LOCK ON dINIT "Game Over" dTEXT "","You scored",2 dTEXT "",misc_padWithZeroes$:(K_hs_numDigits%,score&),2 dBUTTONS "Okay",KKeyEnter% DIALOG LOCK OFF REM find position in table for new score i%=K_hs_tableSize% DO IF score&>G_hs_score&(i%) pos%=i% ENDIF i%=i%-1 UNTIL i%=0 REM if the score is high enough IF pos%>0 REM cascade lower scores i%=K_hs_tableSize% WHILE i%>pos% G_hs_name$(i%)=G_hs_name$(i%-1) G_hs_score&(i%)=G_hs_score&(i%-1) i%=i%-1 ENDWH REM put in newer ones G_hs_name$(pos%)=_hs_getPlayerName$: G_hs_score&(pos%)=score& RETURN Ktrue% ELSE RETURN Kfalse% ENDIFENDPPROC _hs_getPlayerName$: LOCAL newname$(8) newname$="AAA" LOCK ON dINIT "New High Score" dTEXT "","Congratulations!",2 dTEXT "","You're in the high score table.",2 dEDIT newname$,"Your Name" DIALOG LOCK OFF RETURN newname$ENDPREM *********************REM **** ****REM **** Sound Stuff ****REM **** ****REM *********************PROC sound_initialise: EXTERNAL G_sound_volume%,G_sound_playing% MusicSetVolume:(G_sound_volume%) G_sound_playing%=Kfalse%ENDPPROC sound_setupDialog: EXTERNAL G_sound_on%,G_sound_volume% LOCK ON dINIT "Sound Setup" dCHECKBOX G_sound_on%,"Sound" dCHOICE G_sound_volume%,"Volume","Quiet,Medium,Loud" dBUTTONS "Cancel",-KKeyEsc%,"Okay",KKeyEnter% DIALOG LOCK OFF MusicSetVolume:(G_sound_volume%)ENDPPROC sound_highBeep: EXTERNAL G_sound_on%,G_sound_playing%,G_sound_start& IF G_sound_on% MusicNote:(K_sound_highPitch&,K_sound_amplitude%) G_sound_playing%=Ktrue% G_sound_start&=DTNow&: ENDIFENDPPROC sound_midBeep: EXTERNAL G_sound_on%,G_sound_playing%,G_sound_start& IF G_sound_on% MusicNote:(K_sound_midPitch&,K_sound_amplitude%) G_sound_playing%=Ktrue% G_sound_start&=DTNow&: ENDIFENDPPROC sound_lowBeep: EXTERNAL G_sound_on%,G_sound_playing%,G_sound_start& IF G_sound_on% MusicNote:(K_sound_lowPitch&,K_sound_amplitude%) G_sound_playing%=Ktrue% G_sound_start&=DTNow&: ENDIFENDPPROC sound_check:(timenow&) EXTERNAL G_sound_playing%,G_sound_start& REM Check even if sound is off IF G_sound_playing% IF DTMicrosDiff&:(G_sound_start&,timenow&)>K_sound_duration& sound_stop: ENDIF ENDIFENDPPROC sound_stop: EXTERNAL G_sound_playing%,G_sound_start& IF G_sound_playing% DTDeleteDateTime:(G_sound_start&) G_sound_playing%=KFalse% ENDIF musicStop:ENDPPROC sound_close: EXTERNAL G_sound_playing%,G_sound_start& REM just in case sound is currently playing sound_stop: musicStop:ENDPREM ********************REM **** ****REM **** Misc Tools ****REM **** ****REM ********************PROC misc_padWithZeroes$:(width%,number&) LOCAL i% DO i%=i%+1 UNTIL (10**i%)>number& IF i%>width% REM oops, score to big for width RETURN REPT$("9",width%) ENDIF RETURN REPT$("0",(width%-i%))+NUM$(number&,i%)ENDPPROC misc_confirm%:(title$,question$) LOCAL choice% LOCK ON dINIT title$ dTEXT "",question$ dBUTTONS "No",-(%n OR KDButtonNoLabel% OR KDButtonPlainKey%),"Yes",(%y OR KDButtonNoLabel% OR KDButtonPlainKey%) choice%=DIALOG LOCK OFF IF choice%=%y RETURN Ktrue% ELSE RETURN Kfalse% ENDIFENDPREM ********************REM **** ****REM **** Test Stuff ****REM **** ****REM ********************PROC test_specificDevices: REM currently only screen sizes here.  EXTERNAL G_screen_xDim%,G_screen_yDim% REM UNCOMMENT TOSELECT REM It probably would be nicer to do this with constants... REM ah well! REM Custom 1 REM this is the smallest supported screen size  REM G_screen_xDim%=280 REM G_screen_yDim%=160 REM Psion 5 REM OS: ER3 REM G_screen_xDim%=640 REM G_screen_yDim%=240 REM Psion 5mx REM OS: ER5 REM G_screen_xDim%=640 REM G_screen_yDim%=240 REM Psion Revo REM OS: ER5 REM G_screen_xDim%=480 REM G_screen_yDim%=160 REM Psion 7 REM OS: ER5 REM G_screen_xDim%=640 REM G_screen_yDim%=480 REM Psion Netbook REM OS: ER5 REM G_screen_xDim%=640 REM G_screen_yDim%=480  REM Ericsson MC218 REM OS: ER5 REM G_screen_xDim%=640 REM G_screen_yDim%=240 REM Geofox 1 REM OS: ER3 REM it has no touch screen. A sensitive pad was used instead. REM G_screen_xDim%=640 REM G_screen_yDim%=320 REM Oregon Scientific Osaris REM OS: ER4 REM the osaris screen is stretched horizontally. REM G_screen_xDim%=320 REM G_screen_yDim%=200ENDPREM *******************REM **** ****REM **** OPM STUFF ****REM **** ****REM *******************REM this stuff included from file "Loader.tpl", includedREM with OPMs downloaded from Symbian.REM *************************************************************REM * The routines below are the standard OPM Load routines and *REM * should be copied to all applications which use OPMs *REM *************************************************************REM --------------------------------------------------------REM Returns the file position if the file exists on C: or D:REM --------------------------------------------------------PROC OPM_FileLoc$:(file$) IF EXIST ("C:"+file$) RETURN "C:"+file$ ELSE IF EXIST ("D:"+file$) RETURN "D:"+file$ ELSE RETURN "" REM File does not exist ENDIF ENDIFENDPREM -------------------------------------REM Loads in a module held in /System/OpmREM -------------------------------------PROC OPM_LoadModule:(modulename$) LOCAL f$(255) f$=OPM_FileLoc$:("\System\Opm\"+modulename$+".opm") IF f$<>"" LOADM f$ :REM Load the module ELSE ALERT("Cannot find the OPM:","\System\Opm\"+modulename$+".opm") STOP ENDIFENDPREM -------------------------------REM Unloads in a module from memoryREM -------------------------------PROC OPM_UnloadModule:(modulename$) LOCAL f$(255) f$=OPM_FileLoc$:("\System\Opm\"+modulename$+".opm") ONERR notloaded:: UNLOADM f$notloaded:: ONERR OFFENDP\cefd\cefd.A*TextEd.app;7mU; d "RomanN 123LPOT &Heading 1L"Roman < &Heading 2L"Roman < &Heading 3L .Bullet listO Swiss6Bullet list 3O@ Swiss6Bullet list 2O  Swiss. footnoteOSwiss. footnoteOSwiss"Text boxO<@@TitleOh3r `h3r \cefd\cefd1V.AMMr. Meteoroid Game v0.85beta2000 Malcolm TyrrellHello.Thank you for your interest in this lo-fi game.I developed it over a year ago, but I only released a source release due to a dependence on some OPMs from Symbian ( "ini.opm" and "pc_bar.opm" ).Symbian still haven't released final versions of these, so I've included them in the app directory instead of linking against them in "\System\OPM\".To PlayOpen Meteoroid in Program and press "Ctrl+L". This will create "Meteoroid.opo". Tapping this file will run the game.SourcesIf you have downloaded the Sources the instructions on installing the game as an application follow:Open Meteoroid in Program, search for "REM*" and remove all occurences.Press "Ctrl+L", which will automatically put "Meteoroid.app" and "Meteoroid.aif" in "\System\Apps\Meteoroid\".Now copy these four files from the current directory to "\System\Apps\Meteoroid\".Meteoroid.mbm;Meteoroid.hlp;ini.opm, and pc_bar.opm.There should now be a Meteoroid icon in the Extras bar.There is no warranty whatsoever. You use this at your own risk, of course.Enjoy,Malcolm.0ueHoS 8K h  "Roman"Word.app C"C