Dark Bit Factory & Gravity
PROGRAMMING => Other languages => Yabasic => Topic started by: rain_storm on December 11, 2006
-
What happened to all the Yabasic forums?
I can't believe this!!! For years I have been programming on my PS2, occasionally popping into an internet cafe to print out some source code. Recently I bought my friends old Celeron and now I got an internet connection and what do I find? Not much thats what!! This p155#d me off no end. I was just about to abbandon the idea of posting my games until I found this forum and to my delight there is still some activite yabasic fans. praise the lord. Now its just a matter of typing the code and saving it to my PC. Does anyone know a place where I can upload some files? It makes more sense to link to files rather than paste an entire program into a single post.
-
Hi rain_storm,
It was a sad day when the yabasic ezboard forum had to be closed, I think I have done my best to get everyone a new home posting here. It really wasn't financially sensible to keep the place open so a handful of people could talk in the padded cell forum. I suspect other forums have gone the same way. :-\
The great thing about this place, and I'm really glad you found it, is that there are lots of people here interested in programming, in yabasic and other languages, and they're a pretty good bunch to have a yarn with too!
This forum will allow you either to paste in your programs or to upload them as attachments - I think you might need to make 10 posts or more for that feature to be enabled, but someone here will be able to correct that if you want to start posting things right away.
Please feel free to use this place to share code with your friends, or ask programming questions, that's what it is for :D
Have fun!
Jim
-
Hey Rain_Storm, glad to know there are more people who like YaBASIC!
As Jim said, feel free to post your codes up here, and you can download the PC YaBASIC Emulator from the forum... it's worth it if you don't already have it!
Again, Welcome to the DBF Forums.
-
Thank you for the warm welcome Im glad to be here. I am trying my best to get an emulator up and running on Linux but it aint easy. I will be getting a copy of windows xp this week (cost me 27 pounds should be arriving any day now). So expect some input from my side soon. Hey Clanky looks like we are the last of a dying breed. Can't wait to see what suggestions you have for my buggy code.See you all soon :hi:
-
I still run Yabasic stuff, it will be great to have some more Yabasic files posted here, a warm welcome to the board.
-
Ah, the great Shockwave. I still have some of your work saved on one of my memory cards. I think I might post something small tonight bear in mind that I can't yet run it on the PC and it might have a type-o. But nonetheless I still might do it. I would really like to show you some of my work, I have already learned so much from yours.
-
Looks like we still have followers. You have came here seeking salvation. Welcome rain_storm to the fold. Or something.
We'd be happy to help you out with any problems you might have, and can't wait to see what you've got. Maybee I should dig up some of my old work and post it here. Hmmm...
-
Greetings Slinks. This forum is a really friendly place. I am happy I wandered in here. I guese I'll start with something short n sweet. A simple adaption of the snake demo. This code demonstrates basic AI in that each NPC has a set patrol that they stick to like glue. It is forbidden for two bots to occupy the same square. Also the bots are forbidden to collect the randomly placed items. Here goes ...
rem NPC Patrolling 2D Game
label init
st = 8
up = 16
rt = 32
dn = 64
lf = 128
m = 30
gridx = 15
gridy = 15
dim grid(gridx, gridy)
bots = 4
dim posx(bots), posy(bots)
dim patl(bots)
dim patx(bots, 3), paty(bots, 3)
dim laps(bots)
dim look(bots, 3), stay(bots, 3)
restore grid1
for y = 0 to gridy
for x = 0 to gridx
read grid(x, y)
next
next
for b = 1 to bots
for p = 0 to 3
read patx(b, p), paty(b, p)
read look(b, p), stay(b, p)
next
posx(b) = patx(b, 0)
posy(b) = paty(b, 0)
patl(b) = 1
grid(posx(b), posy(b)) = 9
next
posx(0) = 07
posy(0) = 07
grid(posx(0), posy(0)) = 9
open window 640, 512
label draw
setrgb 1, 000, 255, 000
for y = 0 to gridy
gy = y*m
for x = 0 to gridx
if (grid(x, y)=1) then
gx = x*m
fill box gx, gy to gx+m, gy+m
fi
next
next
setrgb 1, 255, 000, 000
for b = 1 to bots
px = posx(b)*m
py = posy(b)*m
fill box px, py to px+m, py+m
grid(posx(b), posy(b)) = 9
next
setrgb 1, 000, 000, 255
px = posx(0)*m
py = posy(0)*m
fill box px, py to px+m, py+m
grid(posx(0), posy(0)) = 9
label item
itemx = int(ran(gridx))
itemy = int(ran(gridy))
if (grid(itemx, itemy)<>0) goto item
grid(itemx, itemy) = 2
setrgb 1, 255, 255, 000
fill box itemx*m, itemy*m to itemx*m+m, itemy*m+m
label game
wait 0.01
bot = bot+1
if (bot > bots) bot = 1
desx = patx(bot, patl(bot))
desy = paty(bot, patl(bot))
if (desx > posx(bot)) then dirx = 1
elsif (desx < posx(bot)) then dirx =-1
else
dirx = 0
fi
if (desy > posy(bot)) then diry = 1
elsif (desy < posy(bot)) then diry =-1
else
diry = 0
fi
newx = posx(bot)+dirx
newy = posy(bot)+diry
if (desx = newx) and (desy = newy) then
laps(bot) = laps(bot)+1
if (laps(bot) = stay(bot, patl(bot))) then
laps(bot) = 0
patl(bot) = patl(bot)+1
if (patl(bot)>3) patl(bot) = 0
fi
fi
hit = grid(newx, newy)
if (hit <> 0) then
newx = posx(bot)
newy = posy(bot)
else
clear fill box posx(bot)*m, posy(bot)*m to posx(bot)*m+m, posy(bot)*m+m
setrgb 1, 255, 000, 000
fill box newx*m, newy*m to newx*m+m, newy*m+m
grid(posx(bot), posy(bot)) = 0
grid(newx, newy) = 9
fi
posx(bot) = newx
posy(bot) = newy
dirx = 0
diry = 0
ctrl = peek("port1")
if (and(ctrl, st) <> 0) exit
if (and(ctrl, up) <> 0) diry =-1
if (and(ctrl, dn) <> 0) diry = 1
if (and(ctrl, lf) <> 0) dirx =-1
if (and(ctrl, rt) <> 0) dirx = 1
newx = posx(0)+dirx
newy = posy(0)+diry
hit = grid(newx, newy)
if (hit = 1) or (hit = 9) then
newx = posx(0)
newy = posy(0)
else
clear fill box posx(0)*m, posy(0)*m to posx(0)*m+m, posy(0)*m+m
setrgb 1, 000, 000, 255
fill box newx*m, newy*m to newx*m+m, newy*m+m
grid(posx(0), posy(0)) = 0
grid(newx, newy) = 9
fi
posx(0) = newx
posy(0) = newy
if (hit = 2) goto item
goto game
label grid1
data 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
data 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
data 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
data 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
data 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
data 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
data 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
data 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
data 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
data 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
data 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
data 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
data 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
data 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
data 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
data 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
rem --------------------------------
rem Patrol Format - desx, desy, look, stay
data 03,03,03,03, 03,12,03,12, 12,12,12,12, 12,03,12,12
data 05,05,03,03, 10,05,03,03, 10,10,03,03, 05,10,03,03
data 01,01,03,03, 01,14,03,03, 14,14,03,03, 14,01,03,03
data 07,01,03,03, 01,07,03,03, 07,14,03,03, 14,07,03,03
Thats it, hope it works.
-
Nice little game! Thanks it works fine. :)
It would be great if you could you start a new thread each time you post something new so everyone can find things, and to avoid emoticons ruining your post, you can use the tags [code ] and [/code ]
to bracket the source, so it scrolls without stretching the forum window and doesn't get corrupted.
Do you have any plans for this program?
Cheers!
Jim
-
Will do in futer, Jim
I aint got any plans for this code atm but I will be implementing this idea in a raytracer Ive been working on. Its not looking tooo good right now Im still looking for a good algorithm but I have the formulas working actually I got a prototype thats only in 2D but it acurately calculates where the extremes of the visual field intersect with a bounding box. I have typed it up and will post it right away. I wanted to combine this patrol routine and the raytracer into a shooter. but until I figure out how to incorporate a third dimension in the formula this one will stay on the back burner.
-
Nice little piece of code. Reminds me of when I first got my PS2 and got bored rather quickly with FIFA only to find YABASIC on the disc and start editing up the examples. Never got very far, mind.
-
Cool :) Nice one Rain Storm, thank you for posting the code.