Scripting, Code & Interaction: Difference between revisions
Jump to navigation
Jump to search
→Defining custom hotkeys and shortcuts
Line 224: | Line 224: | ||
==Defining custom hotkeys and shortcuts== | ==Defining custom hotkeys and shortcuts== | ||
''How can I define a hotkey (keyboard shortcut) in my game?'' | |||
Quite simply, open up the Global Script's '''on_key_press''' function ('''Script -> on_key_press''') and insert conditional ("'''if'''") statements there to check which key(s) were pressed. Search in the manual for '''ASCII code table''' (found under "'''Reference'''" category), and you will see a table of all the ASCII key codes that can be detected in AGS. | |||
If you do not know how to use '''if''' statements within the function to check for key codes, then please learn the basics of scripting first, also found in the AGS manual. | |||
==Having a character continuously animated in the background== | ==Having a character continuously animated in the background== | ||
==Taking away score points.== | ==Taking away score points.== |