Code:
import jj2
gameLoop = jj2.GameLoop()
if gameLoop.get_gameType() == "ctf":
print "Changing to battle..."
gameLoop.set_gameType("battle")
else:
print "Changing to capture the flag..."
gameLoop.set_gameType("ctf")
Just posting a sample of one of the things I have so far... to try and inspire some of you.
(It also automatically checks if the game is running, if you are the server, and if it's the right version of JJ2)
|