Advertisement
Armakuni

a skeleton for a simple basic scrolling game with r2d2

Apr 23rd, 2022
4,760
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 5 print"wait, moving ram":gosub 1220:rem moving charset on ram
  2. 10 poke 53281,0:poke53280,6:print"{clear}":rem colouring screen and clearing
  3. 20 gosub 1040:gosub1190:rem define rd2 sprite and fill buttom screen with chars
  4. 30 rem main cycle
  5. 40 gosub 1290:rem change char for scroll effect
  6. 50 gosub 1330:rem set char to its original state
  7. 60 gosub 600:rem joystick and moving routine
  8. 100 goto 30: rem eternal loop
  9. 600 rem joystick and moving routine
  10. 610 j=peek(56320)
  11. 620 if (j=123) then x=x-5:ifx<30 then x=30
  12. 630 if (j=119) then x=x+5:ifx>255 then x=255
  13. 640 poke53248,x
  14. 650 return
  15. 1040 rem r2d2 sprite
  16. 1045 x=150:y=225:rem r2d2 position
  17. 1050 sz = 832:fort=0to63:reada:pokesz+t,a:next
  18. 1060 poke53269,1:rem activate sprite 1
  19. 1070 poke2040,13:rem sprite pointer for sz=832=13*64
  20. 1080 poke53248,x:poke53249,y:rem sprite 1 x and y
  21. 1090 poke53276,1:rem multicolor sprite 1
  22. 1100 poke53287,1:poke53285,12:poke53286,6:return
  23. 1110 rem r2d2 sprite data
  24. 1120 data 7,192,0,31,220,0,63,80,0,61
  25. 1130 data 92,0,53,116,0,21,220,0,23,111
  26. 1140 data 0,29,171,0,6,171,0,14,219,192
  27. 1150 data 14,90,192,14,122,192,13,122,192,1
  28. 1160 data 154,176,5,166,176,7,234,176,28,234
  29. 1170 data 112,28,234,112,32,59,240,168,15,192
  30. 1180 data 168,10,160,0
  31. 1190 rem fill 2 last lines with petscii 208 purple
  32. 1200 for t=1904 to 2023:poke t,80:poket+54272,4:next
  33. 1210 return
  34. 1220 rem redefining charset
  35. 1230 poke 56334, peek(56334) and 254:rem (interrupts deactivate)
  36. 1240 poke 1, peek(1) and 251:rem (e/a area deactivate, char set rom online)
  37. 1250 for a=53248 to 57343: poke a-40960, peek(a): next a:rem (copy routine)
  38. 1260 poke 1, peek(1) or 4:rem (e/a area activate)
  39. 1270 poke 56334, peek(56334) or 1:rem (interrupts activate)
  40. 1280 poke 53272,peek(53272) and 240 or 12 : rem char set ram at $3000 (sets soft character base address)
  41. 1285 return
  42. 1290 rem modified char
  43. 1310 for t=0to5:poke 12930+t,24:next:rem character 80 redefined
  44. 1320 return
  45. 1330 rem original char
  46. 1340 for t=0to5:poke 12930+t,3:next:rem character 80 redefined
  47. 1350 return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement