Bughunt

Here is a non-yet-commented graphic game for RB. Feel free to change it. The graphics are located on my website. The game will look better if you select "hide editor on run". If you want to stop playing, just choose 0 as your arrows destination, otherwise spend all your arrows or just kill the Giant Bug!

the image subroutine was changed based on a Carl's tip.
 * Updated:**

To play, copy the following code to your clipboard. To copy to your clipboard
 * 1) Highlight the entire code.
 * 2) Right click your mouse on any of the highlighted area.
 * 3) Choose COPY from the drop down menu.

Goto [|Run BASIC] and select the //Write Your Own// tab.

Paste the code into the Run BASIC editor.
 * 1) Right click your mouse in the editor.
 * 2) Choose PASTE from the drop down menu.

code format="vbnet" 'Graphic shooting game 'Game created for Runbasic by apeine 'Graphics taken from Lost Garden's Cutegod 3d tiles 'at: http://lostgarden.com/2007/05/cutegod-prototyping-challenge.html

cls html "Welcome to Bughunt " html " " html "Your village was attacked by a nasty giant bug. After the attack, " html "you were hired to terminate the bug. " html " " html "As the village's best hunter, you have 6 arrows to kill the bug. " html "If you are lucky, you can find a heart in the forest, and it will " html "give you 6 more arrows. " html "If you are close to the bug, you can feel its putrid smell. " html "The village counts on you! Good luck! " html " " input "Press ENTER to continue";a$ [begin] arrow=6 bfind=0 hfind=0 dim x(30) for i=1 to 30 x(i)=0 next i bug=int(rnd(1)*30) + 1 x(bug)=2 [heart] heart=int(rnd(1)*30) + 1 x(heart)=3 if heart=bug then goto [heart] msg$="Welcome to Bughunt" [shoot] gosub [update] html "Arrows= ";arrow html " " input "Choose a tree";shoot if shoot=0 then end end if if shoot 30 then msg$="Invalid shot! Try again!" goto [shoot] end if if shoot=bug then msg$="You hit the bug and kill him!" bfind=1 gosub [update] goto [tryagain] end if if (shoot=(bug+1) or shoot=(bug-1) or shoot=(bug-10) or shoot=(bug+10)) and x(shoot)=0 then msg$="You can smell the bug nearby!" x(shoot)=1 goto [decrease] end if if shoot=heart and hfind=0 then msg$="You found a heart!" hfind=1 arrow=arrow+6 goto [decrease] end if if shoot=heart and hfind=1 then msg$="You have shot there already!" goto [shoot] end if if x(shoot)=1 then msg$="You have shot there already!" goto [shoot] end if msg$="You missed!" x(shoot)=1 goto [decrease] end

[decrease] arrow=arrow-1 if arrow=0 then html "You ran out of arrows! You lost!" goto [tryagain] end if goto [shoot]

[tryagain] input"Want to try again (Y/N)";answer$ if upper$(answer$)="Y" then goto [begin] if upper$(answer$)="N" then end end if goto [tryagain]

[update] cls html " " html ""+msg$+"

" return

sub image img$ base$="http://www.geocities.com/apeine/" html "" end sub

code