A downloadable game

SNAKE Star (C64) by Metzelwurst

#########################


Retro-Game for the BASIC 10Liner Contest 2023

Author: Sönke Schultz (Metzelwurst)

Platform: C64

Language: Commodore BASIC V2

Category: EXTREM-256

#######################


# Control / Steuerung #

 [W] = move snake UP (nach oben bewegen)

 [A] = move snake LEFT (nach links bewegen)

 [S] = move snake DOWN (nach unten bewegen)

 [D] = move snake RIGHT (nach rechts bewegen)

###############


# Description #

You are a snake, pick up all stars.

But take care, don't hit the wall!

(Du bist eine Schlange und musst alle Sterne einsammeln. Aber sei vorsichtig und berühre nicht die Mauer)               

###############


# LINES OVERVIEW #

1 INITIALIZE GAME, CLEAR SCREEN, WRITE HEADER

2 PRINT STARS AND BORDER RIGHT & LEFT

3 SET SOME SMALL WALLS ON SCREEN AND BORDERS UP & DOWN

4 MOVE UP? (KEY W)    

5 MOVE RIGHT? (KEY W), RANDOM ONE WALL ON SCREEN (make it harder)

6 MOVE DOWN? (KEY S)

7 MOVE LEFT? (KEY A), RANDOM ONE STAR ON SCREEN (make it easier)

8 GET STAR? AND CHECK -> LEVEL UP?

9 DRAW SNAKE, REFRESH HEADER, IF HIT BORDER -> GAME OVER?

10 SET CURSOR TO POSITION X Y

####################

# BASIC code (small) see also file "snake-star-Image-Code.png" #

1 POKE53281,0:L=1:?"{CLR}MOVE THE SNAKE:WASD {CBM-+} {WHITE}LEVEL 1 {GREY 3}{CBM-+}{YELLOW} 0  STARS{GREY 3}":WAIT162,32:GETX$:IFX$=""THENGOTO1
2 E=0:POKE53280,L:FORC=1TOL*10:X=INT(RND(1)*38)+1:Y=INT(RND(1)*22)+2:GOSUB10:?"{YELLOW}*":NEXTC:FORC=1TO22:POKE1064+C*40,102:POKE2023-C*40,102:NEXTC
3 FORC=1TOL*2:X=INT(RND(1)*38)+1:Y=INT(RND(1)*22)+2:GOSUB10:?"{LIGHT RED}{CBM-+}":NEXTC:FORC=1TO40:POKE1983+C,102:POKE1104-C,102:NEXTC:D=0:Q=1:R=0:X=9:Y=9:Z=1024+X+(Y*40):U=Z:I=Z:O=Z
4 GETA$:IFA$="W"ORR=-1THENQ=0:R=-1:GOSUB10:?"{SHIFT-Q}":
5 IFA$="D"ORQ=1THENQ=+1:R=0:GOSUB10:?"{SHIFT-Q}":B=1064+INT(RND(1)*880):IF INT(RND(1)*30)=1 THEN POKEB,102
6 IFA$="S"ORR=1THENQ=0:R=+1:GOSUB10:?"{SHIFT-Q}":
7 IFA$="A"ORQ=-1THENQ=-1:R=0:GOSUB10:?"{SHIFT-Q}":B=1064+INT(RND(1)*880):P=PEEK(B):IF INT(RND(1)*30)=1AND(P<>102) THEN POKEB,42
8 O=I:I=U:U=Z:Z=1024+X+(Y*40):X=X+Q:Y=Y+R:P=PEEK(1024+X+(Y*40)):IFP=42THEND=D+1:E=E+1:IFE=10*LTHENL=L+1:X=9:Y=19:GOSUB10:?"GREAT! LOADING {YELLOW}LEVEL"L:POKE781,0:POKE782,31:SYS65520:?"   ":FORC=1TO880:POKE1103+C,62:POKE1103+C,32:NEXTC:GOTO2
9 POKEO,32:POKEI,90:POKEU,90:POKEZ,90:POKE1052,48+L:POKE781,0:POKE782,31:SYS65520:?"{YELLOW}"D:GOSUB10:?"{LIGHT BLUE}{SHIFT-W}":ON-((P<>102)AND(Y<24))GOTO4:X=0:Y=1:GOSUB10:FORC=1TO70:POKE53280,INT(RND(1)*15):?"{RED}***GAME OVER***{UP}{GREY 3}":NEXTC:WAIT198,1:RUN
10 POKE781,Y:POKE782,X:SYS65520:RETURN

#############

# VARIABLES #

 D = STARS COLLECTED (ALL)

 E = STARS COLLECTED (LEVEL)

 L = LEVEL

 Q = X-DIRECTION -1=LEFT 1=RIGHT

 R = Y-DIRECTION -1=UP 1=DOWN

 X = X-COORDINATE

 Y = Y-COORDINATE

 P = CHARACTERCODE ON POS X/Y

     (42=STAR) (102=WALL)

 Z,U,I,O = SAVE POS. OF SNAKE

 C = COUNT-VARIABLE 

 B = RANDOM-VARIABLE          

#############################


# BASIC code (long version) #

See file "snake-star-description.txt"

#######################


# about the developer #

Hello, I am Sönke from Flensburg (Germany) Born near Hamburg (1978). My mother bought a Comodore64 at the end of the 80s. I made my first code experiences when I was 10 years old.

And sometimes, if time (and kids) permit, i connect the c64 on TV :-)

###################################


# Kurz über mich (den Entwickler) #

Hallo, ich bin Sönke aus Flensburg (Deutschland), geboren in der Nähe von Hamburg (1978). Meine Mutter hat sich Ende der 80er Jahre einen Comodore64 gekauft. Meine ersten Code Erfahrungen habe ich mit 10 Jahren gemacht.

Und manchmal, wenn die Zeit (und Kinder) das zulassen, wird der c64 am Fernseher angeschlossen. Der lüppt nämlich noch wie eine 1 :-)

Download

Download
ReadMe-SnakeStar-TenLiner23.txt 3 kB
Download
snake-star.bas 1 kB
Download
snake-star.prg 979 bytes
Download
snake-star.d64 170 kB
Download
snake-star-description.bas 7 kB
Download
snake-star-description.txt 7 kB

Install instructions

# Start game  #

Start the vice emulator, select "file" -> "smart attach disk/tape"

Choose file "snake-star.d64" 

LOAD "snake-star",8,1

RUN

Leave a comment

Log in with itch.io to leave a comment.