Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 5 poke 53280,0:poke 53281,0:poke 646,1:gosub 1000: rem set up the screen
- 10 x=170:y=225: rem set the initial x and y co-ordinates for the sprites
- 70 for n=12800 to n+63: read a: poke n,a:next n: rem put sprite data in memory
- 71 for n=12864 to n+63: read a: poke n,a:next n: rem as above
- 72 for n=12928 to n+63: read a: poke n,a:next n: rem as above
- 73 for n=12992 to n+63: read a: poke n,a:next n: rem as above
- 100 poke 2040,200:poke 2041,201: rem set sprite pointers 0 & 1
- 101 poke 2042,202:poke 2043,203: rem set sprite pointers 2 & 3
- 110 poke 53248,x: rem sprite 0 x pos
- 111 poke 53250,x: rem sprite 1 x pos
- 112 poke 53252,0:ufo=peek(53252): rem sprite 2 x pos
- 120 poke 53249,y: rem sprite 0 y pos
- 121 poke 53251,y-20: rem sprite 1 y pos
- 122 poke 53253,50: rem sprite 2 y pos
- 135 poke 53269,5: rem display sprite 0 & 2
- 136 printchr$(147): rem clear the screen
- 140 k=peek(203): rem see if a key is pressed
- 150 if k=10 then gosub 200: rem if ‘A’ is pressed
- 160 if k=18 then gosub 300: rem if ‘D’ is pressed
- 170 if k=60 then gosub 500: rem if ‘SPACE’ is pressed
- 180 rem line 181 checks if the ufo has reached the ‘edge’ of the screen
- 181 if ufo=255 then ufo=0:poke 53253,peek(53253)+20
- 182 ufo=ufo+5:poke 53252,ufo:rem move ufo right by 5 pixels
- 183 rem line 184 checks if the ufo has hit the launcher
- 184 if peek(53278)>0 then print tab(30)"you lose!":gosub 600
- 190 goto 140: rem go back and check for a key press
- 200 if x>30 then x=x-5: rem if launcher is at left border then stop
- 201 poke 53248,x: rem put new x co-ordinate into sprite 0 location
- 210 return: rem go back from where this sub-routine was called
- 300 if x<255 then x=x+5: rem if launcher is at right border then stop
- 350 poke 53248,x: rem put new x co-ordinate into sprite 0 location
- 360 return: rem go back from where this sub-routine was called
- 500 poke 53269,7:poke 53250,x: rem show sprites 0, 1 & 2
- 501 rem line 520 starts the loop that moves the rocket up the screen
- 520 for m=peek(53251) to 0 step -9:poke 53251,m
- 521 vc=peek(53278): rem check for a collision
- 522 if vc=6 then print tab(32)"you win!":gosub 600: rem collision=win
- 523 poke 53278,0: rem set the collision detection back to none
- 524 if ufo=255 then ufo=0:poke 53253,peek(53253)+20: rem see 180
- 525 ufo=ufo+5:poke 53252,ufo: rem see 182
- 529 next m: rem back through the rocket launch loop
- 530 poke 53269,5: rem once the rocket leaves the screen switch sprite off
- 540 y=peek(53249):poke 53251,y-20: rem reset rocket starting position
- 550 poke 53250,x: rem as 540 but for x co-ordinate
- 590 return: rem go back to where this sub-routine was called
- 600 poke 53278,0: rem switch off collision detection
- 608 rem line 610 sets the collision detection to zero and the x&y…
- 609 rem …co-ordinates for sprite 3
- 610 vc=0:poke 53254,peek(53252):poke 53255,peek(53253)
- 619 rem line 620 flashes the boom sprite only on and off for a few secs
- 620 for o=0 to 200:poke 53269,0:poke53269,8:next o
- 629 rem line 630 switches all sprites off and turns off the collision flags
- 630 poke 53269,0:poke 53278,0:poke 53279,0
- 631 for buf=631 to 640:poke buf,0:next buf: rem clear keyboard buffer
- 632 print"press y to play again,”:?”any other key to quit”
- 633 a$="":get a$:if a$="" then goto 633
- 634 if a$="y" then goto 100
- 636 printchr$(147):poke 53269,0:end
- 1000 rem sprite_0 (launcher) / single colour / colour: 1
- 1010 data 0,0,0,3,0,192,2,255,64,2,0,64,2,0,64,2
- 1020 data 0,64,2,0,64,2,0,64,254,0,127,128,0,1,177,37
- 1030 data 111,170,213,69,178,198,101,170,197,69,170,213,69,169,37,101
- 1040 data 128,0,1,255,255,255,68,164,170,42,74,68,31,255,248,1
- 1050 rem sprite_1 (rocket) / single colour / colour: 1
- 1060 data 0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,0
- 1070 data 36,0,0,66,0,0,82,0,0,74,0,0,82,0,0,74
- 1080 data 0,0,82,0,0,74,0,0,82,0,0,74,0,0,129,0
- 1090 data 1,0,128,2,36,64,2,165,64,2,165,64,1,90,128,1
- 1100 rem sprite_2 (ufo) / single colour / colour: 1
- 1110 data 0,0,0,0,0,0,0,0,0,0,60,0,0,66,0,0
- 1120 data 153,0,1,36,128,1,36,128,1,60,128,31,24,248,33,90
- 1130 data 132,65,60,130,34,0,68,17,255,136,8,0,16,7,255,224
- 1140 data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
- 1150 rem sprite_3 (boom) / single colour / colour: 1
- 1160 data 0,12,0,49,206,24,121,123,57,203,49,111,142,49,192,0
- 1170 data 0,8,241,156,220,155,214,244,154,82,180,178,82,134,178,82
- 1180 data 130,154,82,130,138,210,130,139,146,134,240,30,128,0,0,4
- 1190 data 140,28,196,143,55,102,151,227,26,230,98,6,68,0,2,1
- 2000 return
- run
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement