Dark Bit Factory & Gravity
PROGRAMMING => Other languages => Yabasic => Topic started by: bikemadness on February 05, 2007
-
Hiya everyone.
This is one of my bigger experiments straight from the files Jim transferred from my PS2 to P.C
It's incomplete and untidy, as I ran out of energy.
Up, Down and Left to action.
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
if caught=1 circle x+l+cos((dir+15)*ang)*80,y+sin((dir+15)*ang)*80,5
rem previous line denotes caught fish on line
rem drawing fish will be laborious
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)
text 20,20,str$(l)
text 20,40,str$(y)
text 550,50,"cast"
text 550,65,"strength"
text 580,85,str$(sp)
text 550,110,"fish"
text 550,125,"caught"
text 580,145,str$(catch)
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
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 then rem and l=50*sp then
catch=catch+1
caught=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
caught=0
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
Have a Yahappy day.
-
Thats great Bikemadness I think that this one deserves a topic all its own I love the animation karma + buddy
-
Topic split - much better to start a new topic so everyone sees the new things :D
-
Good idea for a game, fishing! It's difficult though, I played for a couple of minutes without catching anything - which reminds me a lot of going fishing in my childhood!
Jim
-
yeah it looks like nothin happenin in the catches but your points go up and if Im not mistaken a fish dissappears from the river as well but its hard to tell they move so fast
-
Ah, OK.
Have you got 'Sync to 50Hz' turned on in the options? It ran at normal pace for me.
Jim
-
I've tried two options of 'catching fish'. The one that's working now, when reeling in, the end of the line catches all fish running over the top of them. And the other, which I think is there but turned off, catches fish only when the line stops and meets the fish at the same time. Cast strength depends on pull back position.
Have a Yahappy day.
-
I think that this would be very hard if you could only catch fish where the end of the line stopped but at the same time you are garanteed to catch a fish the way it is, like a regular Rex Hunt
-
I think it would be great if you could reel the line in and the fish follow if they are in 'feeding zone' or something?
Then if they eat it a resistance bar appears, and you must reel them in by tapping X without the resistance reaching 100 (or so)... the bigger the fish, the harder they fight back - the quicker the resistance goes up... if the resistance reaches or goes higher than the max resistance - the line snaps and the fish excapes...
Also, maybe there could be a point system where the larger fish scores more points... and you can go shopping for stronger line, better rods and more fish friendly bait or lourers - using the money gained by selling the fish? larger fish attract a larger price?
Great game by the way...
-
Hah! ...well, when you put it like that, who wouldn't want to buy it as a PS2 game.
Of course, you'd have to make sure Nemo the clown fish isn't used, the fishermen are all wearing life-jackets and have them throw back the little ones.
Have a Yahappy day.
-
hah how bout fishin with dynamite?