Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

I also made a game in 20 lines of code! And while I already knew about this feature, I learned a new way to use it.

conditional operators (GameMaker Manual Link)

variable = (condition ? expression1 : expression2);

While above is what I already knew, below is what I learnt from reading the manual during the jam.

function( <parameter_1>, <condition ? parameter_2_a : parameter_2_b> );

Using conditional operators in place of function parameters saved a LOT of lines of code for my game! It allowed me to toggle between a music tack when the game is running and an ambient track for when the player dies. It also allowed me to change the direction and object rotates after a specific amount of time. Fun stuff!