basic code for games