Archery by Retro Programmers Inside
A downloadable game
Archery for TenLiner Basic contest
Computer: Commodore64
Basic: V.2 - PUR120
Emulator: Vice
https://rpinside.itch.io/archery-with-10-line-of-basic-pur-120
This is a simple game, the goal of the game is hit the center of a target with an arrow.
The target moves at a random velocity and the archer (the player) is at fixed position. The player can setting up the angle and the force to hurl the arrow. the score depends on how close the arrow is to the center of the target.
Joystick on Port 2
Left-Right to setup the used force
Up-Down to setup the angle
List of used variables
!- a: joy-up/dw-value -1/1
!- b: joy-left/right-value -1/1
!- c: angle
!- d: Arrow velocity
!- e: paralell to ground velocity (d*cos(k))
!- f: fire (yes<>0)
!- g: 192
!- h: target x starting point
!- i: generic counter
!- j: joy2 value
!- k: used locally in various places
!- kk: angle in radians
!- l: 56320
!- m: perpendicular velocity of the arrow (d*sin(k))
!- n: number of shoots
!- o: 1052
!- p: 53249
!- q: flag for target touched
!- r: 1092
!- rr: distance from target center x component
!- s: game status 0 waiting to start, 1 target is moving, 2 arrow is running, 3 target hitted or arrow on the edge of screen -> Status will became = 0
!- t: time
!- u: distance from target center y component
!- v: target velocity
!- w: arrow elevation
!- x: x target
!- y: y target
!- z: x arrow
!- pu: score
!- zy=12288
!- zx=12480
!- zv=2040
!- zk=128
Reading some constants and initializing video
0reS:rEp,o,r,g,zv,zy,zx,zk,s,y,x,z,t,l,s$,v$,c$,s(0),s(1),s(2),s(3):v=fR(0):goS6:v=3+rN(.)*5:pO53280,0:pO53281,0
Checking for Joystick on port 2 and status, if status = 2 (arrow is running) then wait for status change else if statsu = 3 reinitialize all, else sets values of a, b and f (x,y offset and fire)
1?s$pu;v$v;c$:t=t-(s=2):goS3:ons(s)gO1,0:j=pE(l):on-(j=127)gO1:a=sG(jaN2)-(jaN1):b=sG(jaN4)-sG(jaN8):f=jaN16:iff=0tHgoS9
Update cursors for angle and force (Gosub 9)
If joystick is touched, the target starts moving, if fire is'n clicked go to 1 (onf/16gO1) else calculate the velocity components and come back to 1
2s=1:goS8:onf/16gO1:k=c*({pi}/180):e=d*cos(k):m=d*sI(k):s=2:gO1:dA53248,1052,1092,192,2040,12288,12480,128,0,230,255,90,0
Subroutine that update Sprites positions, if arrow is on the edge of screen or target is hitted update score (go4).
3w=t*m-t*t:x=x+v*(s>0aNx>24):pOp,x:y=y+e*(s=2aNy>59):pOp+3,y:on-((x<25ory<60orw<0aNt>0)orx<=zaNz<x+49aNy<72)gO4:reT
Update score variable if target is hitted, anyway change status variable to 3 for new game.
4q=-(w>0aNw<43aNx<=zaNz<x+49):pO53252,q*((z-x)+26):pO53253,(140-w)*q:u=21-w:rr=24-(z-x):rr=sQ(u*u*q+rr*rr*q)
5pu=pu+int(31-rr)*q:s=3:n=n+1:reT:dA56320,"{home}s"," v","{home}{down*15}facebook: retro programmers inside"
Initialization of screen and sprites
6fOi=0to3:pOzv+i,g+i:nE:on-(n>0)gO8:?"{147}":fOi=0tog:pOzy+i,0:nE:fOi=0to63:pOzy-i*(i<12),x:pO12352-i*(i<12)*3,g:pOzx+i,x:nE
7fOi=0to9:rEc,d:pOp+c+1,d:nE:pO1104,6:pO1064,1:pO12416,zk:c=25:d=c:dA,,1,2,,67,5,26,6,99,20,15,22,12,28,13,38,7,39,1,40
Update then cursors for Angle and Force
8pOp,x:pOp+2,z:pOp+3,y:c=c-a*(c+a>14aNc+a<35):d=d-b*(d+b>14aNd+b<35):fOi=0to2:k=32-49*(i=1):pOo+c-i,k:pOr+d-i,k:nE:reT
Emits the arrow sound when shooted.
9k=54272:fOi=ktok+24:pOi,0:nE:pOk+12,37:pOk+13,15:pOk+24,15:pOk+8,255:pOk+7,255:pOk+11,129:reT:dA,41,7
Complete list:
0reS:rEp,o,r,g,zv,zy,zx,zk,s,y,x,z,t,l,s$,v$,c$,s(0),s(1),s(2),s(3):v=fR(0):goS6:v=3+rN(.)*5:pO53280,0:pO53281,0 1?s$pu;v$v;c$:t=t-(s=2):goS3:ons(s)gO1,0:j=pE(l):on-(j=127)gO1:a=sG(jaN2)-(jaN1):b=sG(jaN4)-sG(jaN8):f=jaN16:iff=0tHgoS9 2s=1:goS8:onf/16gO1:k=c*({pi}/180):e=d*cos(k):m=d*sI(k):s=2:gO1:dA53248,1052,1092,192,2040,12288,12480,128,0,230,255,90,0 3w=t*m-t*t:x=x+v*(s>0aNx>24):pOp,x:y=y+e*(s=2aNy>59):pOp+3,y:on-((x<25ory<60orw<0aNt>0)orx<=zaNz<x+49any<72)go4:ret 4q="-(w">0aNw<43aNx<=zaNz<x+49):po53252,q*((z-x)+26):po53253,(140-w)*q:u=21-w:rr=24-(z-x):rr=sq(u*u*q+rr*rr*q) 5pu="pu+int(31-rr)*q:s=3:n=n+1:reT:dA56320,"{home}s","" v","{home}{down*15}facebook:="" retro="" programmers="" inside"="" 6foi="0to3:pOzv+i,g+i:nE:on-(n">0)gO8:?"{147}":fOi=0tog:pOzy+i,0:nE:fOi=0to63:pOzy-i*(i<12),x:pO12352-i*(i<12)*3,g:pOzx+i,x:nE 7fOi=0to9:rEc,d:pOp+c+1,d:nE:pO1104,6:pO1064,1:pO12416,zk:c=25:d=c:dA,,1,2,,67,5,26,6,99,20,15,22,12,28,13,38,7,39,1,40 8pOp,x:pOp+2,z:pOp+3,y:c=c-a*(c+a>14aNc+a<35):d=d-b*(d+b>14aNd+b<35):fOi=0to2:k=32-49*(i=1):pOo+c-i,k:pOr+d-i,k:nE:reT 9k=54272:fOi=ktok+24:pOi,0:nE:pOk+12,37:pOk+13,15:pOk+24,15:pOk+8,255:pOk+7,255:pOk+11,129:reT:dA,41,7</x+49):po53252,q*((z-x)+26):po53253,(140-w)*q:u=21-w:rr=24-(z-x):rr=sq(u*u*q+rr*rr*q)></x+49any<72)go4:ret>
Status | Released |
Author | BASIC 10Liner |
Genre | Sports |
Tags | 8-Bit, basic, basic10liner, c-64 |
Download
Development log
- Image downloadApr 08, 2021
Leave a comment
Log in with itch.io to leave a comment.