Advertisement
plirof2

Claude TEST BASIC GAME v001

Oct 8th, 2024
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 10 REM ZX Spectrum BASIC Game
  2. 20 PRINT "Welcome to the ZX Spectrum Game!"
  3. 30 PRINT "Use the cursor keys to move the player."
  4. 40 PRINT "Press SPACE to shoot."
  5. 50 PRINT "Avoid the enemy and try to score as many points as possible."
  6. 60 PRINT "Press ENTER to start."
  7. 70 PAUSE 0
  8. 80 CLS
  9. 90 LET x = 12
  10. 100 LET y = 18
  11. 110 LET score = 0
  12. 120 LET enemyx = RND * 22
  13. 130 LET enemyy = RND * 16
  14. 140 PRINT AT y,x;"@"
  15. 150 PRINT AT enemyy,enemyx;"X"
  16. 160 LET k$ = INKEY$
  17. 170 IF k$ = CHR$ 8 THEN LET x = x - 1
  18. 180 IF k$ = CHR$ 9 THEN LET x = x + 1
  19. 190 IF k$ = CHR$ 10 THEN LET y = y - 1
  20. 200 IF k$ = CHR$ 11 THEN LET y = y + 1
  21. 210 IF k$ = " " THEN GOSUB 300
  22. 220 PRINT AT y,x;" "
  23. 230 PRINT AT enemyy,enemyx;" "
  24. 240 IF ABS(x - enemyx) < 2 AND ABS(y - enemyy) < 2 THEN GOTO 350
  25. 250 LET enemyx = RND * 22
  26. 260 LET enemyy = RND * 16
  27. 270 GOTO 140
  28. 300 REM Shoot
  29. 310 FOR i = 1 TO 5
  30. 320 PRINT AT y - i, x + 1;"*"
  31. 330 PAUSE 5
  32. 340 NEXT i
  33. 350 REM Game Over
  34. 360 CLS
  35. 370 PRINT "Game Over. Your score is: ";score
  36. 380 STOP
  37.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement