Recent Posts

Pages: 1 [2] 3 4 ... 10
11
Community news and announcements / Re: QB64 world
« Last post by B+ on 17. February 2018, 13:05:23 »
Mark
 i think that you wasting your time with all this about qb64
 ::)

Water under bridge, even if you are right.
12
Community news and announcements / Re: SmallBasic forum dead or not?
« Last post by B+ on 17. February 2018, 13:00:08 »
Well, at least the on-line samples still work.
13
General questions and discussions / Looking for an old graphic from the old boards
« Last post by ZXDunny on 17. February 2018, 12:49:15 »
Hi guys -

I've been making a huge number of improvements to SpecBAS lately, and as a result have been trawling through my demos seeing if they all still work :)

One is missing a graphic. It was an 8bpp image of a pumpkin/face, used in a demo called "being" iirc. I don't have a copy and of course the old forums are down... It was a hypnotic snake-like affair that writhed around anchored to the centre of the screen.

Anyone still have that image file?

Thanks,

D.
14
Community news and announcements / Re: SmallBasic forum dead or not?
« Last post by B+ on 17. February 2018, 12:38:43 »
Don't know, no warning. No access to site sucks!
15
Community news and announcements / SmallBasic forum dead or not?
« Last post by Aurel on 17. February 2018, 07:16:06 »
Mark

Project web is currently offline pending the final migration of its data to our new datacenter.

what a heck that means ?
16
Community news and announcements / QDepartment End?
« Last post by Aurel on 16. February 2018, 23:38:31 »
it seems to me that QDepartment yahoo group finally end ?
17
Community news and announcements / Re: QB64 world
« Last post by Aurel on 16. February 2018, 23:37:08 »
Mark
 i think that you wasting your time with all this about qb64
 ::)
18
Code and examples / Re: Only for fun
« Last post by B+ on 16. February 2018, 22:55:59 »
Oh ha! Why not clear screen?

Code: [Select]
'Classic animation (Galileo).bas for SmallBASIC 0.12.11 B+=MGA 2018-02-16
'copied from Retro and modified
'// Classic animation program  modified for fun
'// Galileo, 02/2018
'// Powered by Yabasic ;-)

' oh it's our old friend the rotating cube

color rgb(200, 200, 0), 0

pozx = 0
pozy = 0

while 1
   cls
   rysuj()
   delay 10
   pozx = pozx + 2
   pozy = pozy + 2
   '// clear window   <<<<<<<<<<<<<<<<<<< why ?
wend
   

sub rysuj()
   a = pozx / 99
   b = pozy / 99
   for x = -1 to 1
      for y = -1 to 1     
         for z = -1 to 1
            y2 = y
            x2 = x * cos(a) - y2 * sin(a)
            y3 = x * sin(a) + y2 * cos(a)
            y2 = y3
            y3 = y2 * cos(b) - z * sin(b)
            z2 = y2 * sin(b) + z * cos(b)
            sx = 250 + x2 * (z2 + 2) * 35
            sy = 250 + y3 * (z2 + 2) * 35
            size = (z2 + 2) * 5 : colorin = size * 8
            color rgb(colorin, 128 + colorin/128, 128-.5*colorin)
            circle sx, sy, size filled
         next z     
      next y     
   next x
end sub     

19
Code and examples / Re: Simulate the use of complex types and type functions
« Last post by Galileo on 16. February 2018, 20:40:22 »
A simpler example to understand.

The library:

Code: [Select]
// Yabasic 2.78, by Galileo, 02/2018
// Complex type and functions type
// Type defined: MyCircle

items = 1
type() // Initialize array of type objects
items = 0

ps = 1
dim stack(ps) // Free storage stack
ps = 0

sub type() // Complex type MyCircle
dim cx(items) // Coordenate x of the center
dim cy(items) // Coordenate y of the center
dim radius(items) // Circle radius
dim col$(items) // Circle colour in mode "red, green, blue" (0 to 255 each of)
dim mode(items) // Fill mode (true or false)
end sub

sub copy(dest, orig)
cx(dest) = cx(orig)
cy(dest) = cy(orig)
radius(dest) = radius(orig)
col$(dest) = col$(orig)
mode(dest) = mode(orig)
end sub

sub create(parent, cx, cy, radius, col$, mode)
local item

item = stack(ps)
if not item then
items = items + 1
item = items
type()
else
stack(ps) = 0
ps = ps - 1
end if

if parent then
copy(item, parent)
else
cx(item) = cx
cy(item) = cy
radius(item) = radius
if col$ = "" col$ = "0, 0, 0"
col$(item) = col$
mode(item) = mode
end if
return item
end sub

sub destroy(item)
erase(item)
ps = ps + 1
stack(ps) = item
end sub

sub  erase(item)
if mode(item) then
clear fill circle cx(item), cy(item), radius(item)
else
clear circle cx(item), cy(item), radius(item)
end if
end sub

sub draw(item)
color col$(item)
if mode(item) then
fill circle cx(item), cy(item), radius(item)
else
circle cx(item), cy(item), radius(item)
end if
end sub

sub move(item, cx, cy)
erase(item)
cx(item) = cx : cy(item) = cy
draw(item)
end sub

sub resize(item, radius)
erase(item)
radius(item) = radius
draw(item)
end sub

sub colorize(item, col$, mode)
erase(item)
col$(item) = col$
if numparams = 3 mode(item) = mode
draw(item)
end sub

Test program:

Code: [Select]
// Test of complex type MyCircle

import MyCircle

open window 640, 480
backcolor 255, 255, 255
clear window

circle1 = MyCircle.create(0, 100, 100, 25) // create a circle in coords cx, cy with radius = 25. By default, color "0,0,0" (black) and no filler mode
print "Identification of item = ", circle1
MyCircle.draw(circle1)
pause 1
MyCircle.move(circle1, 200, 200)
pause 1
MyCircle.resize(circle1, 50)
pause 1
MyCircle.colorize(circle1, "255, 0, 0", true)
pause 1
MyCircle.destroy(circle1)
pause 1
circle2 = MyCircle.create(0, 300, 200, 75, "0, 0, 255", true)
print "Identification of item = ", circle2 // "reuse" the identificator
MyCircle.draw(circle2)
pause 1
circle3 = MyCircle.create(circle2) // create a new object with attributes of other (is a copy)
print "Identification of item = ", circle3 // new identificator
MyCircle.move(circle3, 100, 100)
MyCircle.draw(circle3) // Hey! Where is my first circle?
pause 1
MyCircle.draw(circle2) // Luckily!
pause 1
MyCircle.colorize(circle3, "0, 255, 0") // So I can already tell them apart.

20
Code and examples / Only for fun
« Last post by Galileo on 16. February 2018, 18:48:47 »
Code: [Select]
// Classic animation program  modified for fun
// Galileo, 02/2018
// Powered by Yabasic ;-)

clear screen
open window 500, 500
backcolor 0, 0, 0
clear window
color 200, 200, 0

pozx = 0
pozy = 0

do
rysuj()
wait 0.03
pozx = pozx + 2
pozy = pozy + 2
// clear window
loop


sub rysuj()
a = pozx / 99
b = pozy / 99
for x = -1 to 1
for y = -1 to 1
for z = -1 to 1
y2 = y
x2 = x * cos(a) - y2 * sin(a)
y3 = x * sin(a) + y2 * cos(a)
y2 = y3
y3 = y2 * cos(b) - z * sin(b)
z2 = y2 * sin(b) + z * cos(b)
sx = 250 + x2 * (z2 + 2) * 35
sy = 250 + y3 * (z2 + 2) * 35
size = (z2 + 2) * 5 : colorin = size * 8
color colorin, colorin, colorin
fill circle sx, sy, size
next z
next y
next x
end sub
Pages: 1 [2] 3 4 ... 10