GameMakerHelpBlog

Friday, December 1, 2006

User imput

Ever wanted for the player to type in something in your game e.g to save a game they need to type it? well this is a simple script to do so
[code]
//draw event!!!!!!!!!!!!!!!!!!!!!!!
text=draw_text(x,y,keyboard_string)
[/code]
so we have the text drawn but how about doing the command???
[code]

//enter pressed
if text="save"
then
str=get_string("filename",'')
game_save(str)
[/code]

there you have it.... this script could be used for commanding your allies in a game very simple script

Labels:

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home