diff options
author | Pablo Moleri <pmoleri@gmail.com> | 2010-09-23 19:18:07 (GMT) |
---|---|---|
committer | Pablo Moleri <pmoleri@gmail.com> | 2010-09-23 19:18:07 (GMT) |
commit | cc1bca2ffdade7e16def981dbb08983ff1571870 (patch) | |
tree | 072dfb1446c13089fa7af49ee1b1cc3e6330caa1 | |
parent | 3f1c735394e4c834d07e40aac883d132e0142700 (diff) |
Changes on game.py to be able to execute from Sugar
-rwxr-xr-x | Saludame.activity/activity.py | 32 | ||||
-rw-r--r-- | Saludame.activity/credits.py | 20 | ||||
-rw-r--r-- | Saludame.activity/credits/saludame.svg | 326 | ||||
-rwxr-xr-x | Saludame.activity/game.py | 38 |
4 files changed, 395 insertions, 21 deletions
diff --git a/Saludame.activity/activity.py b/Saludame.activity/activity.py index b7a7e44..3bfc4ac 100755 --- a/Saludame.activity/activity.py +++ b/Saludame.activity/activity.py @@ -11,6 +11,7 @@ import gobject from gettext import gettext as _ import game +import credits class SaludameActivity(Activity): ''' Clase llamada por sugar cuando se ejecuta la actividad. @@ -27,17 +28,42 @@ class SaludameActivity(Activity): self.game_toolbar = gtk.Toolbar() toolbox.add_toolbar(_("Game"), self.game_toolbar) self.game_toolbar.show() - + + self.credits_toolbar = gtk.Toolbar() + toolbox.add_toolbar(_("Credits"), self.credits_toolbar) + self.credits_toolbar.show() + self.set_toolbox(toolbox) toolbox.show() + # start on the game toolbar, might change this + # to the create toolbar later + self.toolbox.connect('current-toolbar-changed', self.change_mode) + self.toolbox.set_current_toolbar(1) + # Create the canvas to embbed pygame self.pygame_canvas = PygameCanvas(self, False) self.set_canvas(self.pygame_canvas) self.show_all() # Start pygame - self.pygame_canvas.run_pygame(lambda:game.main(True)) # Indico que llame a la función local para iniciar el juego pygame + self.pygame_canvas.run_pygame(lambda:game.Main().main(True)) # Indico que llame a la función local para iniciar el juego pygame def canvas_resize_cb(self): - pass + pass + + def change_mode(self, notebook, index): + if index == 0: + game.pause = True + self.set_canvas(self.pygame_canvas) + + if index == 1: + game.pause = False + self.set_canvas(self.pygame_canvas) + + if index == 2: + game.pause == True + self.credits = credits.Credits() + self.credits.show_all() + self.set_canvas(self.credits) +
\ No newline at end of file diff --git a/Saludame.activity/credits.py b/Saludame.activity/credits.py new file mode 100644 index 0000000..5e5a7bb --- /dev/null +++ b/Saludame.activity/credits.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- + +import gtk +import rsvg + +class Credits(gtk.DrawingArea): + + def __init__(self): + gtk.DrawingArea.__init__(self) + self.connect('expose-event', self._expose_cb) + + + def _expose_cb(self, widget, event): + icon_file = open("credits/saludame.svg", 'r') + data = icon_file.read() + icon_file.close() + + pixbuf = rsvg.Handle(data=data).get_pixbuf() + self.window.draw_pixbuf(None, pixbuf, 0, 0, 0, 0) +
\ No newline at end of file diff --git a/Saludame.activity/credits/saludame.svg b/Saludame.activity/credits/saludame.svg new file mode 100644 index 0000000..ad98f04 --- /dev/null +++ b/Saludame.activity/credits/saludame.svg @@ -0,0 +1,326 @@ +<?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:xlink="http://www.w3.org/1999/xlink" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + id="svg2" + version="1.1" + inkscape:version="0.47 r22583" + width="1200" + height="780" + xml:space="preserve" + sodipodi:docname="saludame.svg"><metadata + id="metadata8"><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 /></cc:Work></rdf:RDF></metadata><defs + id="defs6"><inkscape:perspective + sodipodi:type="inkscape:persp3d" + inkscape:vp_x="0 : 129.30641 : 1" + inkscape:vp_y="0 : 1000 : 0" + inkscape:vp_z="332.51871 : 129.30641 : 1" + inkscape:persp3d-origin="166.25935 : 86.204274 : 1" + id="perspective78" /><linearGradient + x1="0" + y1="0" + x2="1" + y2="0" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(114.53613,0,0,-114.53613,441.28955,333.07178)" + spreadMethod="pad" + id="linearGradient42"><stop + style="stop-opacity:1;stop-color:#4ac200" + offset="0" + id="stop44" /><stop + style="stop-opacity:1;stop-color:#95e700" + offset="1" + id="stop46" /></linearGradient><linearGradient + x1="0" + y1="0" + x2="1" + y2="0" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(114.53613,0,0,-114.53613,441.28955,333.07178)" + spreadMethod="pad" + id="linearGradient62"><stop + style="stop-opacity:1;stop-color:#4ac200" + offset="0" + id="stop64" /><stop + style="stop-opacity:1;stop-color:#95e700" + offset="1" + id="stop66" /></linearGradient><clipPath + clipPathUnits="userSpaceOnUse" + id="clipPath94"><path + d="m 601.399,399.449 c 0.859,-6.443 -0.129,-12.471 11.552,-17.703 l 0,0 c 10.672,-4.779 15.497,-3.82 17.417,-2.84 l 0,0 c 0.408,2.795 1.855,15.096 -3.747,18.947 l 0,0 c -5.967,4.107 -23.289,12.534 -26.732,18.939 l 0,0 c 0.205,-4.995 1.002,-13.529 1.51,-17.343" + id="path96" /></clipPath><linearGradient + x1="0" + y1="0" + x2="1" + y2="0" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(30.950195,0,0,-30.950195,599.88916,397.44824)" + spreadMethod="pad" + id="linearGradient102"><stop + style="stop-opacity:1;stop-color:#4ac200" + offset="0" + id="stop104" /><stop + style="stop-opacity:1;stop-color:#95e700" + offset="1" + id="stop106" /></linearGradient><clipPath + clipPathUnits="userSpaceOnUse" + id="clipPath114"><path + d="m 600.049,413.835 c 3.723,-7.836 10.311,-19.286 18.287,-22.738 l 0,0 c 8.751,-3.782 11.371,-8.629 12.161,-11.202 l 0,0 c 0.486,3.982 1.217,14.461 -3.876,17.958 l 0,0 c -5.967,4.107 -23.289,12.534 -26.732,18.939 l 0,0 c 0.038,-0.888 0.094,-1.89 0.16,-2.957" + id="path116" /></clipPath><linearGradient + x1="0" + y1="0" + x2="1" + y2="0" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(30.950195,0,0,-30.950195,599.88916,398.34375)" + spreadMethod="pad" + id="linearGradient122"><stop + style="stop-opacity:1;stop-color:#4ac200" + offset="0" + id="stop124" /><stop + style="stop-opacity:1;stop-color:#4ac200" + offset="1" + id="stop126" /></linearGradient><clipPath + clipPathUnits="userSpaceOnUse" + id="clipPath134"><path + d="M 0,600 800,600 800,0 0,0 0,600 z" + id="path136" /></clipPath><linearGradient + inkscape:collect="always" + xlink:href="#linearGradient42" + id="linearGradient4316" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(114.53613,0,0,-114.53613,97.923294,13.705519)" + spreadMethod="pad" + x1="0" + y1="0" + x2="1" + y2="0" /><linearGradient + inkscape:collect="always" + xlink:href="#linearGradient62" + id="linearGradient4318" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(114.53613,0,0,-114.53613,97.923294,13.705519)" + spreadMethod="pad" + x1="0" + y1="0" + x2="1" + y2="0" /><linearGradient + inkscape:collect="always" + xlink:href="#linearGradient102" + id="linearGradient4320" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(-30.950195,0,0,-30.950195,1004.6756,78.081979)" + spreadMethod="pad" + x1="0" + y1="0" + x2="1" + y2="0" /><linearGradient + inkscape:collect="always" + xlink:href="#linearGradient122" + id="linearGradient4322" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(-30.950195,0,0,-30.950195,1004.6756,78.977489)" + spreadMethod="pad" + x1="0" + y1="0" + x2="1" + y2="0" /><linearGradient + inkscape:collect="always" + xlink:href="#linearGradient42" + id="linearGradient3713" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(114.53613,0,0,-114.53613,94.297041,13.705519)" + spreadMethod="pad" + x1="0" + y1="0" + x2="1" + y2="0" /><linearGradient + inkscape:collect="always" + xlink:href="#linearGradient62" + id="linearGradient3715" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(114.53613,0,0,-114.53613,94.297041,13.705519)" + spreadMethod="pad" + x1="0" + y1="0" + x2="1" + y2="0" /><linearGradient + inkscape:collect="always" + xlink:href="#linearGradient102" + id="linearGradient3717" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(-30.950195,0,0,-30.950195,1008.3019,78.081979)" + spreadMethod="pad" + x1="0" + y1="0" + x2="1" + y2="0" /><linearGradient + inkscape:collect="always" + xlink:href="#linearGradient122" + id="linearGradient3719" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(-30.950195,0,0,-30.950195,1008.3019,78.977489)" + spreadMethod="pad" + x1="0" + y1="0" + x2="1" + y2="0" /></defs><sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1280" + inkscape:window-height="725" + id="namedview4" + showgrid="false" + inkscape:zoom="0.44500587" + inkscape:cx="695.87547" + inkscape:cy="556.39142" + inkscape:window-x="0" + inkscape:window-y="24" + inkscape:window-maximized="1" + inkscape:current-layer="g12" /><g + id="g12" + inkscape:groupmode="layer" + inkscape:label="saludame" + transform="matrix(1.25,0,0,-1.25,0,780)"><g + id="isologotipo" + transform="translate(3.6262533,0)" + inkscape:label="#g3662"><g + transform="translate(-82.83514,131.02846)" + id="equis"><path + d="m 445.441,386.187 c -5.536,-5.535 -5.536,-14.511 0,-20.046 l 0,0 86.184,-86.187 c 5.535,-5.535 14.512,-5.535 20.049,0 l 0,0 c 5.536,5.537 5.536,14.512 0,20.047 l 0,0 -86.185,86.186 c -2.767,2.769 -6.394,4.154 -10.022,4.154 l 0,0 c -3.628,0 -7.257,-1.385 -10.026,-4.154" + style="fill:url(#linearGradient3713);stroke:none" + id="path48" /><path + d="M 531.625,386.187 445.44,300.003 c -5.535,-5.536 -5.535,-14.512 0,-20.049 l 0,0 c 5.537,-5.535 14.511,-5.535 20.047,0 l 0,0 86.185,86.187 c 5.538,5.535 5.538,14.511 0,20.046 l 0,0 c -2.767,2.769 -6.395,4.154 -10.023,4.154 l 0,0 c -3.628,0 -7.256,-1.385 -10.024,-4.154" + style="fill:url(#linearGradient3715);stroke:none" + id="path68" /></g><g + transform="translate(-82.83514,131.02846)" + id="manzanayhoja"><g + id="caboyhoja" + transform="matrix(-1,0,0,1,1261.1985,0)"><g + transform="translate(631.9438,372.8486)" + id="cabo" + inkscape:label="#g82"><title + id="title3341">cabo</title><path + id="path84" + style="fill:#404407;fill-opacity:1;fill-rule:nonzero;stroke:none" + d="m 0,0 c 0,0 -1.447,16.203 9.256,18.521 3.185,0.289 4.633,0 3.185,3.471 C 10.703,22.57 9.26,24.017 8.969,25.463 6.941,26.045 7.217,24.016 6.5,22.283 5.785,20.546 -3.402,18.23 -2.57,0 -1.143,-0.335 0,0 0,0" /></g><g + id="hoja" + inkscape:label="#g3325"><title + id="title3339">hoja</title><g + id="g86" + transform="translate(630.2739,378.3281)"><path + d="m 0,0 c 0,0 2.684,15.17 -3.652,19.525 -6.336,4.355 -25.457,13.579 -27.205,20.086 -1.752,6.512 -0.067,-13.443 0.793,-19.886 C -29.207,13.278 -30.193,7.25 -18.512,2.017 -3.383,-4.761 0,0 0,0" + style="fill:#11a30a;fill-opacity:1;fill-rule:nonzero;stroke:none" + id="path88" /></g><g + id="g90"><g + id="g92" + clip-path="url(#clipPath94)"><g + id="g98"><g + id="g100"><path + d="m 601.399,399.449 c 0.859,-6.443 -0.129,-12.471 11.552,-17.703 l 0,0 c 10.672,-4.779 15.497,-3.82 17.417,-2.84 l 0,0 c 0.408,2.795 1.855,15.096 -3.747,18.947 l 0,0 c -5.967,4.107 -23.289,12.534 -26.732,18.939 l 0,0 c 0.205,-4.995 1.002,-13.529 1.51,-17.343" + style="fill:url(#linearGradient3717);stroke:none" + id="path108" /></g></g></g></g><g + id="g110"><g + id="g112" + clip-path="url(#clipPath114)"><g + id="g118"><g + id="g120"><path + d="m 600.049,413.835 c 3.723,-7.836 10.311,-19.286 18.287,-22.738 l 0,0 c 8.751,-3.782 11.371,-8.629 12.161,-11.202 l 0,0 c 0.486,3.982 1.217,14.461 -3.876,17.958 l 0,0 c -5.967,4.107 -23.289,12.534 -26.732,18.939 l 0,0 c 0.038,-0.888 0.094,-1.89 0.16,-2.957" + style="fill:url(#linearGradient3719);stroke:none" + id="path128" /></g></g></g></g></g></g><g + id="manzana"><g + transform="translate(685.3013,359.8232)" + id="g78"><path + id="path80" + style="fill:#ef0c0c;fill-opacity:1;fill-rule:nonzero;stroke:none" + d="m 0,0 c 0,0 -11.281,17.939 -29.225,17.361 -17.398,-0.56 -19.009,-1.46 -26.486,-2.25 -7.473,0.79 -9.084,1.69 -26.486,2.25 C -100.133,17.939 -111.42,0 -111.42,0 c 0,0 -22.225,-34.18 13.022,-73.491 14.796,-16.507 28.478,-7.941 42.687,-7.542 14.215,-0.399 27.893,-8.965 42.693,7.542 C 22.227,-34.18 0,0 0,0" /></g><g + clip-path="url(#clipPath134)" + id="g132"><g + transform="translate(672.2837,286.332)" + id="g138"><path + id="path140" + style="fill:#ce0505;fill-opacity:1;fill-rule:nonzero;stroke:none" + d="m 0,0 c 35.244,39.312 13.018,73.491 13.018,73.491 0,0 -2.973,4.719 -8.288,9.24 C 8.461,74.058 14.186,51.78 9.852,32.908 6.238,17.165 -6.322,-1.653 -16.752,-5.124 -33.865,-8.888 -35.008,10.655 -60.998,-4.658 -67.969,-8.77 -84.66,3.17 -93.102,9.796 -90.898,6.577 -88.348,3.308 -85.381,0 -70.584,-16.507 -56.902,-7.94 -42.693,-7.542 -28.479,-7.94 -14.801,-16.507 0,0" /></g><g + transform="translate(594.6958,350.0508)" + id="g142"><path + id="path144" + style="fill:#f2683d;fill-opacity:1;fill-rule:nonzero;stroke:none" + d="m 0,0 c -9.213,-11.185 -12.77,-30.338 -19.738,-24.72 -4.506,3.63 -2.895,28.236 8.099,39.06 12,11.807 29.682,11.956 38.241,4.673 C 32.727,13.801 10.787,13.1 0,0" /></g></g></g></g><g + transform="translate(-82.83514,131.02846)" + id="logotipo"><g + id="g246" + transform="translate(525.7524,259.5244)"><path + d="M 0,0 C 2.734,1.882 10.676,5.746 12.254,8.681 12.16,6.391 11.795,2.479 11.563,0.731 11.168,-2.222 11.621,-4.986 6.266,-7.384 1.375,-9.575 -0.836,-9.136 -1.717,-8.686 -1.904,-7.404 -2.568,-1.767 0,0" + style="fill:#4cdd17;fill-opacity:1;fill-rule:nonzero;stroke:none" + id="path248" /></g><g + id="g250" + transform="translate(429.0024,222.4189)"><path + d="m 0,0 c 2.66,-1.75 6.441,-3.01 10.641,-3.01 4.55,0 8.681,2.45 8.681,7.001 0,3.08 -2.029,5.18 -6.58,7.631 -5.461,2.94 -9.592,6.65 -9.592,12.321 0,9.031 7.842,14.631 17.362,14.631 5.252,0 8.681,-1.26 10.502,-2.38 l -2.66,-6.72 c -1.541,0.839 -4.692,2.17 -8.471,2.099 -5.25,0 -8.192,-3.01 -8.192,-6.16 0,-3.221 2.661,-5.181 7.071,-7.631 5.742,-3.01 9.172,-6.791 9.172,-12.531 0,-9.451 -7.702,-15.262 -18.204,-15.262 -5.74,0.071 -10.429,1.681 -12.531,3.29 L 0,0 z" + style="fill:#4cdd17;fill-opacity:1;fill-rule:nonzero;stroke:none" + id="path252" /></g><g + id="g254" + transform="translate(483.9556,241.3213)"><path + d="m 0,0 c -0.842,0.21 -1.891,0.351 -3.361,0.351 -7.491,0 -13.371,-8.472 -13.371,-16.243 0,-3.57 1.33,-6.51 4.9,-6.51 3.85,0 8.471,4.76 10.082,13.441 L 0,0 z m -3.291,-28.213 c 0,2.03 0.279,4.761 0.561,7.631 l -0.141,0 c -3.359,-6.231 -7.91,-8.401 -12.252,-8.401 -6.09,0 -10.08,4.76 -10.08,11.622 0,11.621 8.121,24.011 24.012,24.011 C 2.52,6.65 6.51,5.95 9.17,5.11 L 5.6,-12.671 C 4.619,-17.712 4.061,-24.152 4.199,-28.213 l -7.49,0 z" + style="fill:#4cdd17;fill-opacity:1;fill-rule:nonzero;stroke:none" + id="path256" /></g><g + id="g258" + transform="translate(491.9341,213.1084)"><path + d="m 0,0 9.451,49.705 8.19,0 L 8.119,0 0,0 z" + style="fill:#4cdd17;fill-opacity:1;fill-rule:nonzero;stroke:none" + id="path260" /></g><g + id="g262" + transform="translate(540.5864,247.2021)"><path + d="m 0,0 -4.48,-23.522 c -0.77,-4.061 -1.26,-7.631 -1.68,-10.572 l -7.281,0 0.769,5.95 -0.141,0 c -3.289,-4.41 -7.56,-6.72 -11.83,-6.72 -4.97,0 -8.89,2.661 -8.89,9.661 0,1.82 0.209,3.78 0.699,6.091 L -29.193,0 l 8.121,0 -3.5,-18.622 c -0.352,-1.681 -0.561,-3.36 -0.561,-4.691 0,-2.8 1.119,-4.831 4.34,-4.831 3.781,0 8.121,4.481 9.522,11.552 L -8.191,0 0,0 z" + style="fill:#4cdd17;fill-opacity:1;fill-rule:nonzero;stroke:none" + id="path264" /></g><g + id="g266" + transform="translate(565.3657,240.3408)"><path + d="m 0,0 c -0.98,0.771 -2.66,1.331 -4.689,1.331 -7.002,0 -12.182,-7.771 -12.182,-15.402 0,-4.13 1.609,-7.351 5.461,-7.351 3.639,0 8.051,3.99 9.381,11.062 L 0,0 z M 12.322,22.473 5.182,-15.051 C 4.41,-19.042 3.852,-23.522 3.641,-27.232 l -7.491,0 0.7,6.02 -0.141,0 c -3.01,-4.62 -7.279,-6.791 -11.689,-6.791 -6.092,0 -10.362,4.901 -10.362,12.602 0,12.041 8.75,23.032 21.281,23.032 1.75,0 3.782,-0.35 5.25,-0.98 l 3.012,15.822 8.121,0 z" + style="fill:#4cdd17;fill-opacity:1;fill-rule:nonzero;stroke:none" + id="path268" /></g><g + id="g270" + transform="translate(599.1763,241.3213)"><path + d="m 0,0 c -0.84,0.21 -1.891,0.351 -3.359,0.351 -7.493,0 -13.373,-8.472 -13.373,-16.243 0,-3.57 1.33,-6.51 4.902,-6.51 3.85,0 8.471,4.76 10.08,13.441 L 0,0 z m -3.291,-28.213 c 0,2.03 0.281,4.761 0.561,7.631 l -0.139,0 c -3.361,-6.231 -7.912,-8.401 -12.252,-8.401 -6.092,0 -10.082,4.76 -10.082,11.622 0,11.621 8.121,24.011 24.014,24.011 3.709,0 7.701,-0.7 10.361,-1.54 L 5.602,-12.671 C 4.621,-17.712 4.061,-24.152 4.201,-28.213 l -7.492,0 z" + style="fill:#4cdd17;fill-opacity:1;fill-rule:nonzero;stroke:none" + id="path272" /></g><g + id="g274" + transform="translate(607.3638,213.1084)"><path + d="m 0,0 4.34,23.522 c 0.771,4.061 1.262,7.631 1.681,10.572 l 7.071,0 -0.77,-5.951 0.139,0 c 3.15,4.55 7.422,6.72 11.902,6.72 5.321,0 7.701,-3.429 7.981,-7 3.08,4.62 7.351,6.931 12.111,7 4.621,0 8.26,-3.009 8.26,-9.1 0,-1.47 -0.279,-3.991 -0.559,-5.811 L 48.445,0 l -7.91,0 3.5,19.042 c 0.279,1.33 0.49,2.94 0.49,4.271 0,2.94 -1.191,4.9 -4.13,4.9 -3.782,0 -7.911,-4.691 -9.241,-11.901 L 28.143,0 20.232,0 23.943,19.322 c 0.209,1.4 0.42,2.731 0.42,3.991 0,2.52 -0.771,4.9 -4.131,4.9 -3.781,0 -8.121,-5.181 -9.38,-12.111 L 7.91,0 0,0 z" + style="fill:#4cdd17;fill-opacity:1;fill-rule:nonzero;stroke:none" + id="path276" /></g><g + id="g278" + transform="translate(679.7466,241.8818)"><path + d="M 0,0 C -5.109,0 -8.471,-4.551 -9.451,-8.682 -1.049,-8.751 4.342,-7.631 4.342,-3.501 4.342,-1.331 2.59,0 0,0 m 7.771,-26.813 c -3.361,-1.75 -7.91,-2.731 -12.041,-2.731 -9.451,0 -14.001,5.811 -14.001,14.142 0,10.291 7.56,21.492 19.322,21.492 6.72,0 10.99,-3.85 10.99,-9.591 0,-8.751 -9.17,-11.551 -22.332,-11.271 -0.139,-1.19 0.141,-3.5 0.91,-4.831 1.33,-2.31 3.781,-3.5 7.002,-3.5 3.85,0 6.93,0.98 9.381,2.241 l 0.769,-5.951 z" + style="fill:#4cdd17;fill-opacity:1;fill-rule:nonzero;stroke:none" + id="path280" /></g></g></g><text + xml:space="preserve" + style="font-size:32px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;text-anchor:middle;fill:#4cdd17;fill-opacity:1;stroke:none;font-family:Arial;-inkscape-font-specification:Arial" + x="478.90625" + y="-231.90706" + id="text2884" + transform="scale(1,-1)"><tspan + sodipodi:role="line" + id="tspan2886" + x="478.90625" + y="-231.90706">Próximamente se mencionaran las personas y</tspan><tspan + sodipodi:role="line" + x="478.90625" + y="-191.90706" + id="tspan3660">organizaciones involucradas en el proyecto</tspan></text> +</g></svg>
\ No newline at end of file diff --git a/Saludame.activity/game.py b/Saludame.activity/game.py index 7f0eb67..ac78622 100755 --- a/Saludame.activity/game.py +++ b/Saludame.activity/game.py @@ -16,6 +16,7 @@ Variables globales """ MAX_FPS = 18 # Max frames per second SLEEP_TIMEOUT = 30 # Seconds until the PauseScreen if no events show up +pause = False class Main(): def __init__(self): @@ -77,24 +78,25 @@ class Main(): events = pygame.event.get() - if events: - for event in events: - if event.type == pygame.QUIT: - running = False - elif event.type == pygame.KEYDOWN and event.key == pygame.K_ESCAPE: - running = False - elif event.type == pygame.MOUSEBUTTONDOWN: - self.windows_controller.handle_mouse_down(pygame.mouse.get_pos()) - - self.windows_controller.handle_mouse_over(pygame.mouse.get_pos()) - - self.windows_controller.update(frames, screen) - - frames += 1 - + if not pause: + + if events: + for event in events: + if event.type == pygame.QUIT: + running = False + elif event.type == pygame.KEYDOWN and event.key == pygame.K_ESCAPE: + running = False + elif event.type == pygame.MOUSEBUTTONDOWN: + self.windows_controller.handle_mouse_down(pygame.mouse.get_pos()) + + self.windows_controller.handle_mouse_over(pygame.mouse.get_pos()) + + self.windows_controller.update(frames, screen) + + frames += 1 + # Una vez que sale del loop manda la senal de quit para que cierre la ventana pygame.quit() - -main = Main() + if __name__ == "__main__": - main.main(False) + Main().main(False) |