Hey jerryd,
Welcome to DBPro! It's so awesome, I hope you have as much fun with it as I do.
Below is some code that I quickly wrote which will hopefully assist you in what you're trying to do.
`Hopefully this will help! Lots of love, BFM.
`An example of hex colour code, 0x(Alpha-00)(Red-00)(Green-00)(Blue-00) I prefer hex code rather than the RGB command.
`If you play with it long enough, you'll start to understand it.
#Constant White 0xFFFFFFFF
#Constant Black 0XFF000000
`Some simple setups so that the text displays correctly.
Backdrop On
Color Backdrop White
Ink Black
`Main program loop
Do
Set Cursor 0,0
`Note how, regardless of the return value, even though the function follows the "IF" statement, it is still executed.
If getkey(Scancode())
Print "Explosions! This is because the function is returning a value ^_^"
Endif
Loop
End
`Now for the functions, always write functions after the main game loop, after END.
Function getkey(key_pressed)
Print "Scancode detected " ; key_pressed ; " ... Yay!"
`Next, if a key is pressed, the example return triggers
If key_pressed > 0
example_return = 1
Endif
`Note how the example_return automagically returns to 0
Endfunction example_return