Author Topic: Fishing Game  (Read 2251 times)

0 Members and 1 Guest are viewing this topic.

Offline bikemadness

  • Amiga 1200
  • ****
  • Posts: 319
  • Karma: 25
  • Hard players don't go home.
    • View Profile
Fishing Game
« on: March 12, 2008 »
I previously posted this at *cough* ezboard.  It didn't show the fish being caught.

Now it does.

D-pad U/D to move fisherman.
D-pad L to pull back rod, (let go to cast)
The further back before you let go, the stronger the cast.
Casting again will release the fish.

Code: [Select]
rem fishing game
open window 640,512
x=70
y=300
dir=330
ang=pi/180
fish=20
catch=0
skip=0.5
walk=5
side=1
man=4
dim aa(man),bb(man),cc(man),dd(man)
dim ee(man),ff(man),gg(man),hh(man)
for a=1 to man
read aa(a),bb(a),cc(a),dd(a),ee(a),ff(a),gg(a),hh(a)
next a
dim fx(fish),fy(fish),fsp(fish)
for a=1 to fish
fx(a)=int(ran(19))*20+170
fy(a)=int(ran(512))
fsp(a)=ran(3)+1
next a
repeat
setdispbuf vm
vm=1-vm
setdrawbuf vm
clear window
setrgb 1,20,200,20
fill rectangle 0,0 to 640,512
setrgb 1,100,75,0
fill rectangle 120,0 to 170,512
fill rectangle 550,0 to 600,512
setrgb 1,80,80,255
fill rectangle 170,0 to 550,512
c=peek("port1")
if recast=1 and and(c,128)>0 then
sp=0
dir=dir-move
else
sp=sp+hold
dir=dir+sp
endif
if and(c,16)>0 then
y=y-2.5
walk=walk+skip
endif
if and(c,64)>0 then
y=y+2.5
walk=walk+skip
endif
if walk>10 or walk<0 skip=-skip
if y<40 y=40
if y>440 y=440
if and(c,16384)>0 then
move=0
else
move=2.5
endif
if dir<180 dir=180
if dir>330 then
dir=330
hold=0
cast=1
else
hold=0.2
cast=0
l=0
endif
setrgb 1,0,0,0
for a=1 to man
line x+cos((dir+aa(a))*ang)*bb(a),y+sin((dir+cc(a))*ang)*dd(a) to x+cos((dir+ee(a))*ang)*ff(a),y+sin((dir+gg(a))*ang)*hh(a)
next a
if cast=0 line x+cos((dir+15)*ang)*80,y+sin((dir+15)*ang)*80 to x+10+cos((dir+15)*ang)*80,y+sin((dir+15)*ang)*80
if cast=1 then
l=l+5
line x+cos((dir+15)*ang)*80,y+sin((dir+15)*ang)*80 to x+l+cos((dir+15)*ang)*80,y+sin((dir+15)*ang)*80
if l>50*sp l=50*sp
endif
line x,y to x,y+30
line x,y+30 to x-10,y+70+(walk)
line x,y+30 to x+10,y+70-(walk-10)
setrgb 1,40,40,40
fill circle x,y-10,10
whip=whip+side
if whip<-2 or whip>2 side=-side
for a=1 to fish
if l+140>fx(a)-10 and l+140<fx(a)+10 and y>fy(a)-10 and y<fy(a)+20 then
fx(a)=l+140
fy(a)=y
endif
fy(a)=fy(a)-fsp(a)
line fx(a)+3,fy(a)-4 to fx(a)+3,fy(a)-20
line to fx(a)+7+(whip/4)*fsp(a),fy(a)-28
line to fx(a)+13+(whip/4)*fsp(a),fy(a)-28
line to fx(a)+17,fy(a)-20
line to fx(a)+17,fy(a)-4
line to fx(a)+14,fy(a)+6
line to fx(a)+10+whip*fsp(a),fy(a)+25
line to fx(a)+6,fy(a)+6
line to fx(a)+3,fy(a)-4
if fy(a)<-10 then
fy(a)=522
fx(a)=int(ran(19))*20+170
endif
if x+l+cos((dir+15)*ang)*80>fx(a) and x+l+cos((dir+15)*ang)*80<fx(a)+20 and y+sin((dir+15)*ang)*80>fy(a) and y+sin((dir+15)*ang)*80<fy(a)+20 and l=50*sp then
catch=catch+1
sp=sp-0.05
if sp<0.2 then
sp=0.2
recast=1
endif
if sp>0.2 recast=0
endif
if l=50*sp then
sp=sp-0.05
if sp<0.2 then
sp=0.2
recast=1
endif
if sp>0.2 recast=0
endif
next a
until (1=0)
data -180,25,-180,25,0,25,0,25
data 0,25,0,25,45,33,45,33
data -180,25,-180,25,135,33,135,33
data 150,40,150,40,15,80,15,80

took me ages to figure this out.
Have a Yahappy day.
I don't know what is wrong with the world - but I know how to fix it.