News:

Welcome to RetroCoders Community

Main Menu

color walker

Started by ron77, May 28, 2023, 06:43 PM

Previous topic - Next topic

ron77

#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)

ron77

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

ron77

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:

You cannot view this attachment.

ZXDunny

Very nice!



Lovely little demo :)