150 likes | 301 Views
GML Key Ideas. GML. GML : Gamemaker Programming Language Looks like java/C++ More power than drag and drop. GML Getting Started. // starts a comment Computer ignores rest of line. GML Getting Started. = is assignment Makes/sets a varaible on left to value on right.
E N D
GML • GML : Gamemaker Programming Language • Looks like java/C++ • More power than drag and drop
GML Getting Started // starts a comment Computer ignores rest of line
GML Getting Started = is assignment Makes/sets a varaible on left to value on right
GML Getting Started name() indicates a function call Does some work for us, gives back an answer
GML Getting Started name() indicates a function call Anything inside ( ) are arguments - extra information to help function do its job Help file documents functions
GML Getting Started • if makes a decision • { } surround block that depends on decision • Else means otherwise do this
GML Variables • A variable set in GML can be used in drag & drop:
Global • Each object has its own variables • Hits in bad guy different than hits in hero
Global • Each object has its own variables • Hits in bad guy different than hits in hero
Global • Each object has its own variables • Hits in bad guy different than hits in hero
Global • Each object has its own variables • Hits in bad guy different than hits in hero
Global • This would be an error:
Global • A variable titled global.XXXX is shared • lasts the entire game • available from everywhere
Global • A variable titled global.XXXX is shared • lasts the entire game • available from everywhere