Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added a background image

  • Loading branch information...
commit b325a50425211e74e29bef64bee0d82a548379f0 1 parent eaf00ce
Carter Sande authored
Showing with 217 additions and 0 deletions.
  1. +3 −0  TypingGame.py
  2. BIN  background.png
  3. +214 −0 background.svg
View
3  TypingGame.py
@@ -57,6 +57,8 @@ def update(self):
wordfile.close()
score = 0
+background = pygame.image.load("background.png").convert()
+
clock = pygame.time.Clock()
while running: #the main loop
clock.tick(20)
@@ -74,6 +76,7 @@ def update(self):
word = TypingGameWord(wordStr)
word.update()
screen.fill((0,0,0)) #clears the screen
+ screen.blit(background,(0,0))
screen.blit(word.image, word.rect) #draw the word
pygame.display.flip() #apply the changes
pygame.quit() #fix the program breaking in IDLE
View
BIN  background.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
214 background.svg
@@ -0,0 +1,214 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="800"
+ height="600"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.48.2 r9819"
+ sodipodi:docname="background.svg"
+ inkscape:export-filename="/Users/csande/Desktop/TypingGame/background.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#000000"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="1"
+ inkscape:pageshadow="2"
+ inkscape:zoom="0.89375"
+ inkscape:cx="400"
+ inkscape:cy="300"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ inkscape:window-width="1200"
+ inkscape:window-height="762"
+ inkscape:window-x="9"
+ inkscape:window-y="0"
+ inkscape:window-maximized="0" />
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-452.36218)">
+ <path
+ sodipodi:type="arc"
+ style="fill:none;stroke:#008a0a;stroke-width:4.09999990000000025;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ id="path2987"
+ sodipodi:cx="399.29578"
+ sodipodi:cy="300.70422"
+ sodipodi:rx="400.70422"
+ sodipodi:ry="302.11267"
+ d="m 800,300.70422 a 400.70422,302.11267 0 1 1 -801.4084473,0 400.70422,302.11267 0 1 1 801.4084473,0 z"
+ transform="matrix(0.99221548,0,0,-1.3987659,3.8125512,1472.977)" />
+ <path
+ transform="matrix(0.83109349,0,0,-1.1716258,68.147883,1404.675)"
+ d="m 800,300.70422 a 400.70422,302.11267 0 1 1 -801.4084473,0 400.70422,302.11267 0 1 1 801.4084473,0 z"
+ sodipodi:ry="302.11267"
+ sodipodi:rx="400.70422"
+ sodipodi:cy="300.70422"
+ sodipodi:cx="399.29578"
+ id="path3757"
+ style="fill:none;stroke:#008a0a;stroke-width:4.09999990000000025;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ sodipodi:type="arc" />
+ <path
+ transform="matrix(0.69385054,0,0,-0.9781489,122.94841,1346.4957)"
+ d="m 800,300.70422 a 400.70422,302.11267 0 1 1 -801.4084473,0 400.70422,302.11267 0 1 1 801.4084473,0 z"
+ sodipodi:ry="302.11267"
+ sodipodi:rx="400.70422"
+ sodipodi:cy="300.70422"
+ sodipodi:cx="399.29578"
+ id="path3763"
+ style="fill:none;stroke:#008a0a;stroke-width:4.09999990000000025;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ sodipodi:type="arc" />
+ <path
+ sodipodi:type="arc"
+ style="fill:none;stroke:#008a0a;stroke-width:4.09999990000000025;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ id="path3765"
+ sodipodi:cx="399.29578"
+ sodipodi:cy="300.70422"
+ sodipodi:rx="400.70422"
+ sodipodi:ry="302.11267"
+ d="m 800,300.70422 a 400.70422,302.11267 0 1 1 -801.4084473,0 400.70422,302.11267 0 1 1 801.4084473,0 z"
+ transform="matrix(0.58117887,0,0,-0.81931114,167.93774,1298.7325)" />
+ <path
+ transform="matrix(0.48056524,0,0,-0.67747206,208.11233,1256.0809)"
+ d="m 800,300.70422 a 400.70422,302.11267 0 1 1 -801.4084473,0 400.70422,302.11267 0 1 1 801.4084473,0 z"
+ sodipodi:ry="302.11267"
+ sodipodi:rx="400.70422"
+ sodipodi:cy="300.70422"
+ sodipodi:cx="399.29578"
+ id="path3767"
+ style="fill:none;stroke:#008a0a;stroke-width:4.09999990000000025;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ sodipodi:type="arc" />
+ <path
+ sodipodi:type="arc"
+ style="fill:none;stroke:#008a0a;stroke-width:4.09999990000000025;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ id="path3769"
+ sodipodi:cx="399.29578"
+ sodipodi:cy="300.70422"
+ sodipodi:rx="400.70422"
+ sodipodi:ry="302.11267"
+ d="m 800,300.70422 a 400.70422,302.11267 0 1 1 -801.4084473,0 400.70422,302.11267 0 1 1 801.4084473,0 z"
+ transform="matrix(0.40252813,0,0,-0.56746004,239.27222,1222.9998)" />
+ <path
+ sodipodi:type="arc"
+ style="fill:none;stroke:#008a0a;stroke-width:4.09999990000000025;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ id="path3771"
+ sodipodi:cx="399.29578"
+ sodipodi:cy="300.70422"
+ sodipodi:rx="400.70422"
+ sodipodi:ry="302.11267"
+ d="m 800,300.70422 a 400.70422,302.11267 0 1 1 -801.4084473,0 400.70422,302.11267 0 1 1 801.4084473,0 z"
+ transform="matrix(0.33605649,0,0,-0.47375229,265.81406,1194.8215)" />
+ <path
+ transform="matrix(0.28148559,0,0,-0.39682152,287.604,1171.6881)"
+ d="m 800,300.70422 a 400.70422,302.11267 0 1 1 -801.4084473,0 400.70422,302.11267 0 1 1 801.4084473,0 z"
+ sodipodi:ry="302.11267"
+ sodipodi:rx="400.70422"
+ sodipodi:cy="300.70422"
+ sodipodi:cx="399.29578"
+ id="path3773"
+ style="fill:none;stroke:#008a0a;stroke-width:4.09999990000000025;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ sodipodi:type="arc" />
+ <path
+ sodipodi:type="arc"
+ style="fill:none;stroke:#008a0a;stroke-width:4.09999990000000025;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ id="path3777"
+ sodipodi:cx="399.29578"
+ sodipodi:cy="300.70422"
+ sodipodi:rx="400.70422"
+ sodipodi:ry="302.11267"
+ d="m 800,300.70422 a 400.70422,302.11267 0 1 1 -801.4084473,0 400.70422,302.11267 0 1 1 801.4084473,0 z"
+ transform="matrix(1.4282537,0,0,-2.0134665,-170.29566,1657.82)" />
+ <path
+ sodipodi:type="arc"
+ style="fill:none;stroke:#008a0a;stroke-width:4.09999990000000025;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ id="path3779"
+ sodipodi:cx="399.29578"
+ sodipodi:cy="300.70422"
+ sodipodi:rx="400.70422"
+ sodipodi:ry="302.11267"
+ d="m 800,300.70422 a 400.70422,302.11267 0 1 1 -801.4084473,0 400.70422,302.11267 0 1 1 801.4084473,0 z"
+ transform="matrix(1.1923985,0,0,-1.6809719,-76.119666,1557.8375)" />
+ <path
+ transform="matrix(0.99876954,0,0,-1.4080054,1.1955544,1475.7554)"
+ d="m 800,300.70422 a 400.70422,302.11267 0 1 1 -801.4084473,0 400.70422,302.11267 0 1 1 801.4084473,0 z"
+ sodipodi:ry="302.11267"
+ sodipodi:rx="400.70422"
+ sodipodi:cy="300.70422"
+ sodipodi:cx="399.29578"
+ id="path3781"
+ style="fill:none;stroke:#008a0a;stroke-width:4.09999990000000025;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ sodipodi:type="arc" />
+ <path
+ sodipodi:type="arc"
+ style="fill:none;stroke:#008a0a;stroke-width:4.09999990000000025;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ id="path3783"
+ sodipodi:cx="399.29578"
+ sodipodi:cy="300.70422"
+ sodipodi:rx="400.70422"
+ sodipodi:ry="302.11267"
+ d="m 800,300.70422 a 400.70422,302.11267 0 1 1 -801.4084473,0 400.70422,302.11267 0 1 1 801.4084473,0 z"
+ transform="matrix(0.82586265,0,0,-1.1642516,70.236531,1402.4576)" />
+ <path
+ transform="matrix(0.69175405,0,0,-0.97519341,123.78553,1345.6069)"
+ d="m 800,300.70422 a 400.70422,302.11267 0 1 1 -801.4084473,0 400.70422,302.11267 0 1 1 801.4084473,0 z"
+ sodipodi:ry="302.11267"
+ sodipodi:rx="400.70422"
+ sodipodi:cy="300.70422"
+ sodipodi:cx="399.29578"
+ id="path3785"
+ style="fill:none;stroke:#008a0a;stroke-width:4.09999990000000025;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ sodipodi:type="arc" />
+ <path
+ transform="matrix(0.57752097,0,0,-0.81415444,169.39831,1297.1819)"
+ d="m 800,300.70422 a 400.70422,302.11267 0 1 1 -801.4084473,0 400.70422,302.11267 0 1 1 801.4084473,0 z"
+ sodipodi:ry="302.11267"
+ sodipodi:rx="400.70422"
+ sodipodi:cy="300.70422"
+ sodipodi:cx="399.29578"
+ id="path3787"
+ style="fill:none;stroke:#008a0a;stroke-width:4.09999990000000025;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ sodipodi:type="arc" />
+ <path
+ sodipodi:type="arc"
+ style="fill:none;stroke:#008a0a;stroke-width:4.09999990000000025;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ id="path3789"
+ sodipodi:cx="399.29578"
+ sodipodi:cy="300.70422"
+ sodipodi:rx="400.70422"
+ sodipodi:ry="302.11267"
+ d="m 800,300.70422 a 400.70422,302.11267 0 1 1 -801.4084473,0 400.70422,302.11267 0 1 1 801.4084473,0 z"
+ transform="matrix(0.4837396,0,0,-0.6819471,206.84483,1257.4266)" />
+ <path
+ style="fill:none;stroke:#008a0a;stroke-width:7.3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m 400.00029,1061.9122 0,-653.52115"
+ id="path3791"
+ inkscape:connector-curvature="0" />
+ </g>
+</svg>
Please sign in to comment.
Something went wrong with that request. Please try again.