[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

GScript BASIC updated



Added animate() command, and a new animation code call "ball".

An updated version now available here at:

http://virtualgs.larwe.com/basic/

Since I have separated GScript and GScript BASIC projects into 2
separate directions, I have change the URL (again) to put GScript
BASIC at its own folder (/basic rather than /GScript/basic).

Ball code:

x = 320
y = 200
dx = rnd(5) + 5
dy = rnd(5) + 5

hgr()
hcolor = rnd(15) + 1
print("Bouncing ball...")
animate(draw)

function draw() {
    hgr()
    x = x + dx
    y = y + dy

    if (x > 540 || x < 100) {
        hcolor = rnd(15) + 1
        dx = dx * -1
    }

    if (y > 300 || y < 100) {
        hcolor = rnd(15) + 1
        dy = dy * -1
    }

    circle(x, y, 100)
}