[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: GSoft BASIC ditty - Wiggle
- Subject: Re: GSoft BASIC ditty - Wiggle
- From: Marlin Allred <ma@is6.slc.unisys.com>
- Date: 1998/08/20
- Newsgroups: comp.sys.apple2
- Organization: Unisys Corporation
- References: <6ri2r4$j9d$1@pale-rider.INS.CWRU.Edu>
I notice that this program looks at the keyboard directly. How difficult
is it to go through the event tools?
Marlin
On 20 Aug 1998, John L. Graham wrote:
>
> I'm having a lot of fun exploring Gsoft BASIC. It's a great language for
> recreational programming. One example I hacked out over lunch today is given
> below. This little program, called Wiggle, draws a dots that wiggles its way
> around the screen leaving a trial of different colors behind it.
>
> Have fun!
>
> John
>
> -----------------------------------snip-----------------------------------------
>
> X0% = 160
> Y0% = 100
> X1% = 160
> Y1% = 100
>
> HGR
>
> KEY% = 0
> COUNTER% = 0
> COLOR0% = 1
> COLOR1% = 2
> DO UNTIL (KEY% = 83 OR KEY% = 115)
> WHILE (COUNTER% < 1000 AND KEY% <> 83 AND KEY% <> 115)
> DX% = SGN ( RND (1) - 0.5) * 1
> DY% = SGN ( RND (1) - 0.5) * 1
> X1% = X0% + DX%
> Y1% = Y0% + DY%
> IF X1% > 320 THEN X1% = 320
> IF X1% < 0 THEN X1% = 0
> IF Y1% > 200 THEN Y1% = 200
> IF Y1% < 0 THEN Y1% = 0
> HCOLOR= COLOR0%
> HPLOT X0%, Y0%
> HCOLOR= COLOR1%
> HPLOT X1%, Y1%
> X0% = X1%
> Y0% = Y1%
> COUNTER% = COUNTER% + 1
> KEY% = PEEK ($00C000)
> WEND
> COUNTER% = 0
> COLOR0% = COLOR0% + 1
> IF COLOR0% = 16 THEN COLOR0% = 1
> COLOR1% = COLOR1% + 1
> IF COLOR1% = 16 THEN COLOR1% = 1
> LOOP
>
>
>