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: PUR-120


### 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)     

          

### Start game  #######################

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

Choose file "snake-star.d64" 

LOAD "snake-star",8,1


RUN

### LINES OVERVIEW ####################

1 initialize the game, clear screen, write info on first line/header

2 put stars on screen and border left/right

3 set some small walls on screen and border up/down

4 read char, print snake-head, move up or down? (KEY W / S)

5 move right? (KEY D), random one wall on screen (make it harder)

6 move left? (KEY A), random one star on screen (make it easier)

7 save snake and get a star?

8 check if enough was collected, Level up?

9 draw snake, if border is hit, is that GAME OVER?

10 refresh header, set cursor to position X Y


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

1 POKE53281,0:?"{CLR}MOVE THE SNAKE=WASD {CBM-+} {WHITE}LEVEL 1 {GREY 3}{CBM-+}{YELLOW} 0  STARS{GREY 3}":L=1:D=0:WAIT162,32:GETX$:IFX$=""THENGOTO1
2 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:Q=1:R=0:X=9:Y=9
4 GETA$:GOSUB10:?"{LIGHT BLUE}{SHIFT-Q}":IF(A$="W"ORR=-1)OR(A$="S"ORR=1)THENQ=0:T=R:R=-1:IF(A$="S"ORT=1)THENR=+1 
5 IFA$="D"ORQ=1THENQ=+1:R=0:B=1064+INT(RND(1)*880):IFINT(RND(1)*30)=1THENPOKEB,102
6 IFA$="A"ORQ=-1THENQ=-1:R=0:B=1064+INT(RND(1)*880):P=PEEK(B):IFINT(RND(1)*30)=1AND(P<>102)THENPOKEB,42
7 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
8 IFD=10*LTHENL=L+1:X=9:Y=19:GOSUB10:?"NEXT {YELLOW}LEVEL"L:D=0:Z=1393:U=Z:I=Z:POKE1056,32:POKE1057,32:FORC=1TO880:POKE1103+C,32:NEXTC:GOTO2 
9 POKEO,32:POKEI,90:POKEU,90:POKEZ,90:GOSUB10:?"{LIGHT BLUE}{SHIFT-W}":ON-((P<>102)AND(Y<24))GOTO4:X=3:Y=4:GOSUB10:?"{RED}*GAME OVER*{UP}{GREY 3}":WAIT198,1:RUN
10 POKE1052,48+L:POKE781,0:POKE782,31:SYS65520:?"{YELLOW}"D:POKE781,Y:POKE782,X:SYS65520:RETURN


### VARIABLES #########################

 D = 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

 T = TEMP/SAVE-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 :-)

StatusReleased
Rating
Rated 5.0 out of 5 stars
(1 total ratings)
AuthorBASIC 10Liner
GenreAction
Tags8-Bit, basic, basic10liner, commodore, Commodore 64

Download

Download
ReadMe-SnakeStar-TenLiner23.txt 3.7 kB
Download
snake-star.bas 1.1 kB
Download
snake-star.d64 170 kB
Download
snake-star.prg 884 bytes
Download
snake-star-description.bas 7.5 kB
Download
snake-star-description.txt 7.5 kB
Download
snake-star-short.bas 1.1 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

Development log

Comments

Log in with itch.io to leave a comment.

(1 edit)

This snake game made in basic is very cute.