GetDotted Domains

Viewing Thread:
"is it as YABASIC as they say?"

The "Sony Games" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.

Fri 29/06/01 at 19:43
Regular
Posts: 787
i dont know if many of you know (you probably do your quite smart) but on that little demo disc that came tuked away with your ps2 in the box aswel as games and videos there is also a little something called YABASIC (yet another basic.)
this alows you to create your very own games which can be very difficult if you know hardly anything about codeing games.well im not very good at cding so i loaded on some demo games already built into the program and i was very happy to find snake.well on thisits called worm but none the less its snake with a bit of a twist and paint brush style graphics.but its not the graphics that matter.
any way after a while of playing worm i wanted to make my own game but i thought i would start small and i just tweaked the settings on the game but soon this caused the game to not run and i didnt know how to sort out the problem.
so i turned to the internet for guidence.
i found a couple of sites on YABASIC and they had coding for some rather good games one of which you may of heared of:
who wants to be a millionaire.
but they also had the all time classic game, the game that started the games industry pong.
incase you want a go at coding pong into your PS2 hear is the code:

PADS = 2



BAT_HEIGHT = 80

BAT_WIDTH = 8

BAT_SPEED = 10

BAT_OFFSET = 20



BALL_RADIUS = 6

BALL_SPEED = 11



XSIZE = 640

YSIZE = 512



main()



sub main()

init()



cont = 1



wait_controller("Press any button to start.")



while(cont = 1)

draw_new_field()



update_bat(left_bat(), "PORT1", 16, 64)

if (PADS = 2) then

update_bat(right_bat(), "PORT2", 16, 64)

else

update_bat(right_bat(), "PORT1", 4096, 16384)

endif



update_ball()



pause 0.05

wend

end sub



sub update_bat(bat(), addr$, up, down)

local maxstep



if (and(peek(addr$), down) > 0) then

maxstep = YSIZE - (bat(2) + (bat(4) / 2))

bat(2) = bat(2) + min(maxstep, BAT_SPEED)

elsif (and(peek(addr$), up) > 0) then

maxstep = bat(2) - (bat(4) / 2)

bat(2) = bat(2) - min(maxstep, BAT_SPEED)

endif

end sub



sub update_ball()

b_newx = ball(1) + ball(5) * cos(ball(4))

b_newy = ball(2) + ball(5) * sin(ball(4))

b_newr = ball(3)

b_newa = ball(4)

b_news = ball(5)



check_topbot_collission()

check_bat_collission(left_bat())

check_bat_collission(right_bat())

check_leftright_collission()



ball(1) = b_newx

ball(2) = b_newy

ball(3) = b_newr

ball(4) = b_newa

ball(5) = b_news

end sub



sub check_topbot_collission()

local r, y_toomuch



r = ball(3)



if (b_newy < r) then

b_newy = r + (r - b_newy)

b_newa = (2 * pi) - b_newa

beep

endif



if (b_newy > (YSIZE - r)) then

y_toomuch = r + (b_newy - YSIZE)

b_newy = YSIZE - (y_toomuch + r)

b_newa = (2 * pi) - b_newa

beep

endif

end sub



sub check_leftright_collission()

local r, reinit



r = b_newr

reinit = 0



if (b_newx < r) then

score(2) = score(2) + 2

reinit = 1

beep

elsif (b_newx > (XSIZE - r)) then

score(1) = score(1) + 1

reinit = 1

beep

endif



if (reinit = 1) then

b_newx = XSIZE / 2

b_newy = YSIZE / 2

b_newa = random_angle()



wait_controller("Press any button to start.")

endif

end sub



sub check_bat_collission(bat())

local a, b, x, y, rev, bx_n, bx_o

local ignore, y_top, y_bot, too_much



if (bat(1) > (XSIZE / 2)) then

x = bat(1) - (bat(3) / 2)

rev = -1

bx_o = ball(1) + ball(3)

bx_n = b_newx + b_newr

if (bx_o >= bx_n) then

ignore = 1

elsif ((bx_o > x) or (bx_n < x)) then

ignore = 1

endif

else

x = bat(1) + (bat(3) / 2)

rev = 1

bx_o = ball(1) - ball(3)

bx_n = b_newx - b_newr

if (bx_o <= bx_n) then

ignore = 1

elsif ((bx_o < x) or (bx_n > x)) then

ignore = 1

endif

endif



if (ignore = 0) then

rem Let's give the players a bit of slack (b_newr / 2)



y_top = bat(2) - (bat(4) / 2) - (b_newr / 2)

y_bot = bat(2) + (bat(4) / 2) + (b_newr / 2)



a = (ball(2) - b_newy) / (ball(1) - b_newx)

b = b_newy - (a * b_newx)



y = a * x + b



if (y >= y_top and y <= y_bot) then

if (b_news > 2 * b_newr) then

draw_the_ball(x + (rev * b_newr), y, b_newr)

endif



too_much = b_newx - (x + (rev * b_newr))

b_newx = (x + (rev * b_newr)) - too_much



b_newa = pi - b_newa

endif

endif

end sub



sub draw_new_field()

buffer = 1 - buffer

setdrawbuf buffer

setrgb 0, 64, 127, 64

clear window

draw_bat(left_bat())

draw_bat(right_bat())

draw_ball()

draw_score()

setdispbuf buffer

end sub



sub draw_ball()

draw_the_ball(ball(1), ball(2), ball(3))

end sub



sub draw_the_ball(x, y, r)

setrgb 1, 127, 127, 127



fill circle x, y, r

end sub



sub draw_bat(bat())

local ltx, lty, rbx, rby



ltx = bat(1) - (bat(3) / 2)

lty = bat(2) - (bat(4) / 2)

rbx = bat(1) + (bat(3) / 2)

rby = bat(2) + (bat(4) / 2)



setrgb 1, 127, 127, 127

fill rectangle ltx, lty, rbx, rby

end sub



sub draw_score()

setrgb 1, 0, 0, 0



text 50, 20, str$(score(1)), "cc"

text XSIZE - 50, 20, str$(score(2)), "cc"

end sub



sub init()

init_structures()

init_screen()

end sub



sub init_structures()

rem ball: x, y, radius, angle, speed

dim ball(5)

init_ball()



rem left_bat: x, y (center), width, height

dim left_bat(4)

left_bat(1) = BAT_OFFSET

left_bat(2) = YSIZE / 2

left_bat(3) = BAT_WIDTH

left_bat(4) = BAT_HEIGHT



rem right_bat: x, y (center), width, height

dim right_bat(4)

right_bat(1) = XSIZE - BAT_OFFSET

right_bat(2) = YSIZE / 2

right_bat(3) = BAT_WIDTH

right_bat(4) = BAT_HEIGHT



rem score: left, right

dim score(2)

score(1) = 0

score(2) = 0

end sub



sub init_ball()

ball(1) = XSIZE / 2

ball(2) = YSIZE / 2

ball(3) = BALL_RADIUS

ball(4) = random_angle()

ball(5) = BALL_SPEED

end sub



sub random_angle()

local r



r = ran() * 2 * pi



rem These angles keep the game interesting

while (((r > 0.4 * pi) and (r < 0.6 * pi)) or ((r > 1.4 * pi) and (r < 1.6 * pi)))

r = ran() * 2 * pi

wend



return r

end sub



sub init_screen(text$)

open window XSIZE, YSIZE

buffer = 0

setdrawbuf buffer

setrgb 0, 64, 127, 64

clear window

end sub



sub wait_controller(text$)

setrgb 1, 0, 0, 0



text XSIZE / 2, YSIZE / 2, text$, "cc"



while (or(peek("PORT1"), peek("PORT2")) = 0)

pause 0.02

wend

end sub


It needs to be set out as you see it in front of you.
but let me warn you first before you run of to your PS2 if you dont have a memory card i advise you not to try coding.

WHY?
well i was putting in this code which believe me is very boring to do, i had done about a quatre of it and i had just had enough i couldnt keep going it was soooooooooo boring.if i had a memory card i could of saved the bit i had done and continued another day and another reasen is if you do manage to finish the code and get it working sucsefully you wont be able to save and every time you want to play it again you have to code it again.
so if you really want to get your code on but have no PS2 memory card i would buy one from ukgames.com i know memory cards are a lot but ukgames (special reserve) have one of the best prices.

Or if you cant be bothered to copy a code on to your PS2 and have or havent got a memory card you can download a PS2 YABASIC emulator onto your PC and just copy/paste the code into that - its a lot easy.


____________
chris douch
Sat 30/06/01 at 22:29
Regular
"Jim Jam Jim"
Posts: 5,626
I programmed something in YABASIC. Without a keyboard its very annoying and hard to do. I started to write a little adventure game using my knoledge from programming in Pascal. I only got a few lines in but as I didnt know too much it was doing what I wanted it to do so I deleted it. I havent been on it since as I just want to play games, and not spend hours typing in code when I can do it 1000 times quicker on a PC.
Sat 30/06/01 at 18:28
Regular
"You've upset me"
Posts: 21,152
Chris (great name by the way :-D) Just thought you should know, Kid Rock tried to rip this off as his own.
Sat 30/06/01 at 12:01
Regular
"Vote For Pedro"
Posts: 5,679
no
Sat 30/06/01 at 11:19
Posts: 0
were you trying to break the record for the longest posting on this site or what
Sat 30/06/01 at 10:58
Regular
"Vote For Pedro"
Posts: 5,679
has any pne coded their own game on YABASIC?
Fri 29/06/01 at 20:05
Regular
"You've upset me"
Posts: 21,152
Oops, I mean Resieveil fan...
Fri 29/06/01 at 20:04
Regular
"You've upset me"
Posts: 21,152
Lol Vottanoator!
Fri 29/06/01 at 20:01
Regular
"Vote For Pedro"
Posts: 5,679
yeah i heared that.
Yabasic made it classed as a computer and not just a games console which let them avoid tax,
Fri 29/06/01 at 19:59
Regular
"Back For Good"
Posts: 3,673
YAbasicw as just an excuse for sony not to pay tax.

I edited my worms thing to start on the level you die on and to be very very rude haha
Fri 29/06/01 at 19:43
Regular
"Vote For Pedro"
Posts: 5,679
i dont know if many of you know (you probably do your quite smart) but on that little demo disc that came tuked away with your ps2 in the box aswel as games and videos there is also a little something called YABASIC (yet another basic.)
this alows you to create your very own games which can be very difficult if you know hardly anything about codeing games.well im not very good at cding so i loaded on some demo games already built into the program and i was very happy to find snake.well on thisits called worm but none the less its snake with a bit of a twist and paint brush style graphics.but its not the graphics that matter.
any way after a while of playing worm i wanted to make my own game but i thought i would start small and i just tweaked the settings on the game but soon this caused the game to not run and i didnt know how to sort out the problem.
so i turned to the internet for guidence.
i found a couple of sites on YABASIC and they had coding for some rather good games one of which you may of heared of:
who wants to be a millionaire.
but they also had the all time classic game, the game that started the games industry pong.
incase you want a go at coding pong into your PS2 hear is the code:

PADS = 2



BAT_HEIGHT = 80

BAT_WIDTH = 8

BAT_SPEED = 10

BAT_OFFSET = 20



BALL_RADIUS = 6

BALL_SPEED = 11



XSIZE = 640

YSIZE = 512



main()



sub main()

init()



cont = 1



wait_controller("Press any button to start.")



while(cont = 1)

draw_new_field()



update_bat(left_bat(), "PORT1", 16, 64)

if (PADS = 2) then

update_bat(right_bat(), "PORT2", 16, 64)

else

update_bat(right_bat(), "PORT1", 4096, 16384)

endif



update_ball()



pause 0.05

wend

end sub



sub update_bat(bat(), addr$, up, down)

local maxstep



if (and(peek(addr$), down) > 0) then

maxstep = YSIZE - (bat(2) + (bat(4) / 2))

bat(2) = bat(2) + min(maxstep, BAT_SPEED)

elsif (and(peek(addr$), up) > 0) then

maxstep = bat(2) - (bat(4) / 2)

bat(2) = bat(2) - min(maxstep, BAT_SPEED)

endif

end sub



sub update_ball()

b_newx = ball(1) + ball(5) * cos(ball(4))

b_newy = ball(2) + ball(5) * sin(ball(4))

b_newr = ball(3)

b_newa = ball(4)

b_news = ball(5)



check_topbot_collission()

check_bat_collission(left_bat())

check_bat_collission(right_bat())

check_leftright_collission()



ball(1) = b_newx

ball(2) = b_newy

ball(3) = b_newr

ball(4) = b_newa

ball(5) = b_news

end sub



sub check_topbot_collission()

local r, y_toomuch



r = ball(3)



if (b_newy < r) then

b_newy = r + (r - b_newy)

b_newa = (2 * pi) - b_newa

beep

endif



if (b_newy > (YSIZE - r)) then

y_toomuch = r + (b_newy - YSIZE)

b_newy = YSIZE - (y_toomuch + r)

b_newa = (2 * pi) - b_newa

beep

endif

end sub



sub check_leftright_collission()

local r, reinit



r = b_newr

reinit = 0



if (b_newx < r) then

score(2) = score(2) + 2

reinit = 1

beep

elsif (b_newx > (XSIZE - r)) then

score(1) = score(1) + 1

reinit = 1

beep

endif



if (reinit = 1) then

b_newx = XSIZE / 2

b_newy = YSIZE / 2

b_newa = random_angle()



wait_controller("Press any button to start.")

endif

end sub



sub check_bat_collission(bat())

local a, b, x, y, rev, bx_n, bx_o

local ignore, y_top, y_bot, too_much



if (bat(1) > (XSIZE / 2)) then

x = bat(1) - (bat(3) / 2)

rev = -1

bx_o = ball(1) + ball(3)

bx_n = b_newx + b_newr

if (bx_o >= bx_n) then

ignore = 1

elsif ((bx_o > x) or (bx_n < x)) then

ignore = 1

endif

else

x = bat(1) + (bat(3) / 2)

rev = 1

bx_o = ball(1) - ball(3)

bx_n = b_newx - b_newr

if (bx_o <= bx_n) then

ignore = 1

elsif ((bx_o < x) or (bx_n > x)) then

ignore = 1

endif

endif



if (ignore = 0) then

rem Let's give the players a bit of slack (b_newr / 2)



y_top = bat(2) - (bat(4) / 2) - (b_newr / 2)

y_bot = bat(2) + (bat(4) / 2) + (b_newr / 2)



a = (ball(2) - b_newy) / (ball(1) - b_newx)

b = b_newy - (a * b_newx)



y = a * x + b



if (y >= y_top and y <= y_bot) then

if (b_news > 2 * b_newr) then

draw_the_ball(x + (rev * b_newr), y, b_newr)

endif



too_much = b_newx - (x + (rev * b_newr))

b_newx = (x + (rev * b_newr)) - too_much



b_newa = pi - b_newa

endif

endif

end sub



sub draw_new_field()

buffer = 1 - buffer

setdrawbuf buffer

setrgb 0, 64, 127, 64

clear window

draw_bat(left_bat())

draw_bat(right_bat())

draw_ball()

draw_score()

setdispbuf buffer

end sub



sub draw_ball()

draw_the_ball(ball(1), ball(2), ball(3))

end sub



sub draw_the_ball(x, y, r)

setrgb 1, 127, 127, 127



fill circle x, y, r

end sub



sub draw_bat(bat())

local ltx, lty, rbx, rby



ltx = bat(1) - (bat(3) / 2)

lty = bat(2) - (bat(4) / 2)

rbx = bat(1) + (bat(3) / 2)

rby = bat(2) + (bat(4) / 2)



setrgb 1, 127, 127, 127

fill rectangle ltx, lty, rbx, rby

end sub



sub draw_score()

setrgb 1, 0, 0, 0



text 50, 20, str$(score(1)), "cc"

text XSIZE - 50, 20, str$(score(2)), "cc"

end sub



sub init()

init_structures()

init_screen()

end sub



sub init_structures()

rem ball: x, y, radius, angle, speed

dim ball(5)

init_ball()



rem left_bat: x, y (center), width, height

dim left_bat(4)

left_bat(1) = BAT_OFFSET

left_bat(2) = YSIZE / 2

left_bat(3) = BAT_WIDTH

left_bat(4) = BAT_HEIGHT



rem right_bat: x, y (center), width, height

dim right_bat(4)

right_bat(1) = XSIZE - BAT_OFFSET

right_bat(2) = YSIZE / 2

right_bat(3) = BAT_WIDTH

right_bat(4) = BAT_HEIGHT



rem score: left, right

dim score(2)

score(1) = 0

score(2) = 0

end sub



sub init_ball()

ball(1) = XSIZE / 2

ball(2) = YSIZE / 2

ball(3) = BALL_RADIUS

ball(4) = random_angle()

ball(5) = BALL_SPEED

end sub



sub random_angle()

local r



r = ran() * 2 * pi



rem These angles keep the game interesting

while (((r > 0.4 * pi) and (r < 0.6 * pi)) or ((r > 1.4 * pi) and (r < 1.6 * pi)))

r = ran() * 2 * pi

wend



return r

end sub



sub init_screen(text$)

open window XSIZE, YSIZE

buffer = 0

setdrawbuf buffer

setrgb 0, 64, 127, 64

clear window

end sub



sub wait_controller(text$)

setrgb 1, 0, 0, 0



text XSIZE / 2, YSIZE / 2, text$, "cc"



while (or(peek("PORT1"), peek("PORT2")) = 0)

pause 0.02

wend

end sub


It needs to be set out as you see it in front of you.
but let me warn you first before you run of to your PS2 if you dont have a memory card i advise you not to try coding.

WHY?
well i was putting in this code which believe me is very boring to do, i had done about a quatre of it and i had just had enough i couldnt keep going it was soooooooooo boring.if i had a memory card i could of saved the bit i had done and continued another day and another reasen is if you do manage to finish the code and get it working sucsefully you wont be able to save and every time you want to play it again you have to code it again.
so if you really want to get your code on but have no PS2 memory card i would buy one from ukgames.com i know memory cards are a lot but ukgames (special reserve) have one of the best prices.

Or if you cant be bothered to copy a code on to your PS2 and have or havent got a memory card you can download a PS2 YABASIC emulator onto your PC and just copy/paste the code into that - its a lot easy.


____________
chris douch

Freeola & GetDotted are rated 5 Stars

Check out some of our customer reviews below:

Best Provider
The best provider I know of, never a problem, recommend highly
Paul
Everybody thinks I am an IT genius...
Nothing but admiration. I have been complimented on the church site that I manage through you and everybody thinks I am an IT genius. Your support is unquestionably outstanding.
Brian

View More Reviews

Need some help? Give us a call on 01376 55 60 60

Go to Support Centre

It appears you are using an old browser, as such, some parts of the Freeola and Getdotted site will not work as intended. Using the latest version of your browser, or another browser such as Google Chrome, Mozilla Firefox, or Opera will provide a better, safer browsing experience for you.