Jump to content
Sign in to follow this  
adamantyr

10 Line XB Entry: Cannon

Recommended Posts

100 CALL CLEAR :: CALL CHAR(128,"03060C183060F0FC1818",130,"8142241818244281FF8199A5A59981FF",136,"0") :: CALL COLOR(14,13,13)
110 CALL HCHAR(24,1,136,32) :: CALL VCHAR(23,1,128) :: CALL SPRITE(#2,131,7,185,48+RND*96) :: DISPLAY AT(1,1):"SCORE:";SC :: A=0 :: P=10
120 R=185-32*COS(A) :: C=1+32*SIN(A) :: CALL SPRITE(#1,130,2,R,C) :: DISPLAY AT(3,1):"POWER:";P
130 CALL KEY(3,K,S) :: IF K=68 THEN A=MIN(PI/2,A+0.1) :: GOTO 120 ELSE IF K=83 THEN A=MAX(0,A-0.1) :: GOTO 120
140 IF K=69 THEN P=MIN(P+1,30) :: GOTO 120 ELSE IF K=88 THEN P=MAX(P-1,1) :: GOTO 120 ELSE IF K=32 THEN 150 ELSE 120
150 Y=-P*COS(A) :: X=P*SIN(A) :: CALL SOUND(-100,-7,2) :: CALL SPRITE(#1,129,2,176,5,Y,X)
160 FOR I=1 TO 3 :: CALL COINC(ALL,K) :: CALL POSITION(#1,R,C) :: NEXT I :: IF K THEN 180 ELSE Y=MIN(Y+1,10) :: CALL MOTION(#1,Y,X)
170 IF R<188 THEN 160 ELSE CALL DELSPRITE(ALL) :: GOTO 110
180 CALL DELSPRITE(ALL) :: SC=SC+10 :: CALL SOUND(-100,2000,2,3000,2) :: GOTO 110

I threw this one together for the contest. It won't win, I don't think, but fun to put together. :)

 

Use S and D to change the angle of the cannon, and E and X to increase or decrease power, and space to fire. 10 points every time you hit the target.

 

I have NOT tested if every location is accessible, nor if the coincidence checking is thorough enough to always get a hit. For 9 lines though it's pretty decent.

  • Like 8

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...