TGC Codebase Backup



Basic Principles of Scancode by MikeS

27th Jan 2004 13:41
Summary

Teaches and generates code for all the scancodes.(DB and DBP)



Description

Teaches and generates code for all the scancodes.(DB and DBP)



Code
                                    ` This code was downloaded from The Game Creators
                                    ` It is reproduced here with full permission
                                    ` http://www.thegamecreators.com
                                    
                                    `This tutorial was made by Mike(Yellow)
`Feel free to use this as you please, as long as you
`don't claim ownership over it.
`Enjoy!


`In this tutorial you'll learn about the scancode
`It basically is used when you want to know what key is
`being pressed
`
`For Example:
`If you make a First Person shooter, and want 1-9 to
`Change weapons, you'd use keystates from 2-10

do              ` This sets up your basic do statement
cls             ` This clears the screen so only have 1 key press

print "The current keys scancode is ";scancode()  `Print command is used to display text and scancode
Print "This can be used with the"
Print "If keystate(";scancode();")=1 "
print "command to detect whether it's being used."
Print
Print
Print "Please resort to your manual for other common keystates(mouseclick,returnkey,etc.)"


loop             ` This keeps the loop going