Hello, I'm a beginner to python; I wanted to make a fun little game, so I started with something simple: Rock, Paper, Scissors.<br><br>The
program I made satisfies me, but I want to add graphics. I installed pygame, and have some svg's that I want to render into graphics. I installed cairo, but then realized that it is only used to draw svg's and other graphics into files, not render them on the screen. Any ideas how to start turning this into a graphical game? Feel free to add any
other suggestions as well :D:D:D! Thanks.
<br><br>Here is the source code:<br><br>#! /usr/bin/env python<br>##########Rock Paper Scissors, By: John Jelinek IV##########<br>##########GLOBAL VARS#######################################<br>import random<br>import os
<br>random = random.Random()<br>##########FUNCTIONS#########################################<br>def clear(): # Clear's the screen<br> os.system("clear")<br>def rounds(): # Asks how many rounds
<br> rnum = input("How many rounds?!?: ")<br> while rnum == 1 or rnum%2 == 0 or rnum <= -1:<br> print "Must be an odd number of rounds and more than 1, try again!"<br> rnum = input("How many rounds?!?: ")
<br> return rnum<br>def rps(rounds): # Begins the real game<br><br> win = 0<br> lose = 0<br> tie = 0<br><br> for i in range(1,rounds+1):<br> decision = ('rock', 'paper', 'scissors')
<br> player = ''<br> ai = random.choice(decision)<br><br> while player != 'r' and player != 'p' and player != 's':<br> print "\nROUND ", + i<br> player = raw_input('What will YOU choose? (r)ock, (p)aper, (s)cissors: ')
<br><br> if player == 'r':<br> player = 'rock'<br> elif player == 'p':<br> player = 'paper'<br> else:<br> player = 'scissors'<br>
<br> print "====================="<br> print "you chose " + player.upper(),<br> print ":: I choose " + ai.upper()<br><br> if player.upper() == 'ROCK' and ai.upper
() == 'SCISSORS':<br> win += 1<br> print "You WIN by CRUSHING those SCISSORS!"<br> elif player.upper() == 'PAPER' and ai.upper() == 'ROCK':<br> win += 1
<br> print "You WIN by WRAPPING that ROCK!"<br> elif player.upper() == 'SCISSORS' and ai.upper() == 'PAPER':<br> win += 1<br> print "You WIN by CUTTING that PAPER!"
<br> elif player.upper() == ai.upper():<br> tie += 1<br> print "YOU TIE!"<br> else:<br> lose += 1<br> print "YOU LOSE!"<br><br> print "\nRounds Won: ", + win
<br> print "\nRounds Lost: ", + lose<br> print "\nRounds Tied: ", + tie<br>##########BEGIN PROGRAM#####################################<br>clear()<br>print "Welcome to ROCK PAPER SCISSORS! PREPARE FOR BATTEL!!\n\n"
<br>rounds = rounds()<br>rps(rounds)<br>##########END PROGRAM#######################################<br>print "\n\nThanks for playing!\n"<br><br>