04.03.2013 Views

spectrum graphics - OpenLibra

spectrum graphics - OpenLibra

spectrum graphics - OpenLibra

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Program Breakdown<br />

A brief program is included in the form of REM statements within<br />

the program but for those of you who are interested what follows<br />

is a more detailed program including notes on what certain<br />

special commands (e.g. the POKEs) do.<br />

1 5 GOSUBs the UDGs. Originally these were part<br />

of the main program but were changed to a<br />

subroutine so that they were set up to be<br />

printed in the instructions.<br />

20 The POKE sets the computer in CAPS LOCK<br />

mode.<br />

25 Sets up variables that should not be reset at<br />

the start of a new game.<br />

30 Initialises variables that need defining at the<br />

beginning of each new game.<br />

52 GOSUBs the main instructions.<br />

60 99 Asks for the User Defined keys. Enter can be<br />

used as a key but will present problems in<br />

lines 9300 9550.<br />

900 995 Sets up variables needed for stage one<br />

including:<br />

91 0 P is set up to hold the print positions and<br />

types of obstacles.<br />

950 GOSUBs the NEXT STAGE and brief<br />

instruction reminders subroutine.<br />

990 This POKE stops the computer asking<br />

'scroll ?' at line 1070.<br />

995 GOSUBs the traffic light countdown<br />

subroutine, Both this and the subroutine<br />

activated at line 950 occur at the start of each<br />

stage.<br />

1000-1 070 Contains the main body of Stage 1.<br />

1900 1 980 Checks for INKEY$ and detects collisions.<br />

2000 Gives you a bonus for completing Stage 1 and<br />

GOSUBs the congratulations message (also<br />

activated each stage).<br />

2020-2040 Determines the width of the roof and sets up<br />

the screen.<br />

2100-2220 Contains the Stage 2 'action'.<br />

2510-2590 Prints the chimney and determines the speed<br />

for Stage 3.<br />

2600-2800 Stage 3 proper.<br />

301 0 3090 Initialises screen and variables for Stage 4.<br />

3100 31 30 Stage 4 routine when there is no snowball.<br />

3200 3240 Ditto for when there is a snowball present.<br />

3300 3330 Performs Santa's leap over the Christmas<br />

tree.<br />

3600 361 7 Sets up the variables and screen for the next<br />

stage. Note that the INK colour is set to 5<br />

(cyan) yet the houses are printed in yellow so<br />

that their ATTRibutes are different. Thus a<br />

collision with the houses can be detected<br />

using the ATTR command in line 372.<br />

3620 3800 Contains the main part of Stage 5.<br />

From there on the REM statements serve |ust as well as a<br />

description would so you can go through them if you need a<br />

breakdown of the latter parts of the program $ mainly<br />

subroutines.<br />

1 REM<br />

•Underlined characters*<br />

*are entered in *<br />

*GRAPHTCS mode. *<br />

TT IT R ~ W TiTTTirTTTTTTTTTItinr<br />

M ¥ ¥ If ¥ ¥ ¥ ¥ ¥ ¥ ¥ W M w<br />

10 REM INITIALISE SREEN AND<br />

27 GO SUB 101<br />

SOME VARIABLES<br />

SANTA'S CAME<br />

75 LET H = 0: DIM H*(10)<br />

10 LET Y=l: DIM K*(4): LET L=*5<br />

: LET S = 0<br />

40 BRIGHT 0: PAPER 0: BORDER 0<br />

: CLS t POKE 23658,8<br />

50 INK 6: PRINT AT 0,2} BRIGHT<br />

1?"SANTA'S CHRISTMAS NIGHTMARE'<br />

"JTAB 2 ; - * —— •• '"- " 1<br />

52 GO SUB 9200<br />

55 RFM DFFINE KEYS<br />

S7 INK 6: PRINT AT 0,2; BRIGHT<br />

ti"SANTA'S CHRISTMAS NIGHTMARE'<br />

" ; T A B 25" ""* 'J—f »••<br />

60 INK 5: PRINT AT 5,0;"WHICH<br />

KEYS WOULD YOU LIKE LEFT:"<br />

'*"RIGHT:'''"UP:"''"DOWN!•<br />

70 FOR F=1 TO 4: PRINT AT F*7 +<br />

6, 10; FLASH 1 J<br />

80 LET R*=INKEY«: IF R$"" TH<br />

EN GO TO 80<br />

90 LET R*»INKEY«: IF R*«"" THE<br />

N GO TO 90<br />

95 BEEP .03,20: PRINT AT F*2 + 6<br />

,10;RS: LET K$(F)=R«: NEXT F<br />

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!