RetroCoders Community

FreeBasic Programming => FreeBasic => Topic started by: ron77 on May 28, 2023, 06:43 PM

Title: color walker
Post by: ron77 on May 28, 2023, 06:43 PM
#lang "qb"
x = 20
y = 20
c = 0

cls

do
    key$ = inkey$
    color c
    locate y,x,0  :' 0 turns cursor off
    print "@";

    if key$ = "w" then y=y-1
    if key$ = "a" then x=x-1
    if key$ = "d" then x=x+1
    if key$ = "s" then y=y+1
    if key$ = "c" then c=c+1
    if c > 16 then c = 0

loop until key$ = chr$(27)
Title: Re: color walker
Post by: ron77 on May 28, 2023, 07:22 PM
hi aurel

compile and run the code and press key "c" to change color of the "@" then move it by pressing keys "w" "s" "a" "d" you can change the color again and again by pressing key "c"

hopes this helps
Title: Re: color walker
Post by: ron77 on May 28, 2023, 09:35 PM
don't know what to say aurel i don't know why it doesn't work on your computer

however, it does work on mine. Here is a screen capture:

color-walker.png
Title: Re: color walker
Post by: ZXDunny on May 30, 2023, 01:55 PM
Very nice!

(https://i.ibb.co/9Gvdj8Y/screenshot-1797.png)

Lovely little demo :)