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

Re: GScript BASIC updated



limtc wrote:
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

Does "dx = -dx" work?

-michael

AppleCrate II: An Apple II "blade server"!
Home page:  http://members.aol.com/MJMahon/

"The wastebasket is our most important design
tool--and it's seriously underused."