Code for joust game