home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ahoy 1985 April
/
Ahoy_Magazine_85-04_1985_Double_L.d64
/
joy64
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
740b
|
43 lines
1 rem commodore 64 joystick
2 rem
3 rem use second joystick port
4 rem
10 gosub 600:gosub 500
80 v=10:h=10
90 goto 140
97 rem
98 rem main movement loop
99 rem
100 s=peek(56320)
101 if (s and 1)=0 then v=v-1:if v<0 then v=v+bf
102 if (s and 2)=0 then v=v+1:if v>be then v=v-bf
103 if (s and 4)=0 then h=h-1:if h<0 then h=h+rf
104 if (s and 8)=0 then h=h+1:if h>re then h=h-rf
105 if (s and 16)=0 then end
110 if h=hx and v=vx then 100
140 print vm$(vx)tab(hx)" "vm$(v)tab(h)pf$
150 hx=h:vx=v
190 goto 100
497 rem
498 rem set up movement strings
499 rem
500 dim vm$(be):vm$(0)=chr$(19)
510 for i=1 to be:vm$(i)=vm$(i-1)+chr$(17):next i
540 return
597 rem
598 rem set up screen margins
599 rem
600 re=38
605 rf=39
610 be=23
615 bf=24
617 rem
618 rem player figure
619 rem
620 pf$=chr$(122)
627 rem
628 rem screen color
629 rem
630 poke 53281,1:poke 53280,1:print chr$(147)
690 return