think about it like this.
the keyboard and mouse (but mostly keyb) in qb is the only link you have between your executable program and the user.
so what you need to do is create a program that loops, and gets keyboard input every loop.
and then you need to "translate" that input into the execution of code.
so say we got a dot at 30, 40 on the screen
change that into vars, dotx, doty and fill em:
Quote:dotx = 30
doty = 40
pset ( dotx, doty ), 15 'puts the dot there as a white dot
so heres pseudo code (this next part wont run, but its the idea you must grasp)
Code:
loop ------------------------------------------------|
|
if presskey( "up" ) then gosub upthing |
|
|
pset ( dotx, doty ), 15 |
|
loop until presskey( "escape" )-----------------------|
end
upthing:
doty = doty - 1
return
hope it makes sense, i can do a bit more later if time allows
before the big party tonight ;D (anyone from nw illinois here? :P:P)
edit: i'll add a version that runs:
Code:
screen 13 'graphics!
dotx = 30
doty = 40
do
keyin$ = inkey$ 'grab keyboard input
if keyin$ = chr(0) + "H" then gosub upthing
'Don't worry if this seems weird, it's basically just a qb hack to get the arrows.
'this is the up arrow (duh..)
pset ( dotx, doty ), 15
loop until keyin$ = chr$(27) 'the code for the escape key
end
upthing:
if doty > -1 then 'add check to keep the dot from going off screen
doty = doty - 1
end if
return
youll notice, it draws a line. but in reality, this isnt drawing a line, its drawing single dots, the old ones are just never erased