Mercurial > rinkhals
changeset 586:36e1939c732a 1.5.x
Merge r588, r589 and r590 from trunk.
author | Simon Cross <hodgestar@gmail.com> |
---|---|
date | Sat, 28 Nov 2009 23:14:13 +0000 |
parents | cae2d8634f50 |
children | e13f9380242b |
files | TODO data/icons/easter_egg.png data/icons/easter_egg.svg data/sprites/equip_easter_egg.png data/sprites/equip_easter_egg.svg gamelib/main.py regenerate_pngs.py |
diffstat | 7 files changed, 276 insertions(+), 97 deletions(-) [+] |
line wrap: on
line diff
--- a/TODO Sat Nov 28 22:55:30 2009 +0000 +++ b/TODO Sat Nov 28 23:14:13 2009 +0000 @@ -2,69 +2,16 @@ == POST PYWEEK == -* Add invalid cursor sprite +* Add invalid cursor sprite (mostly when placing buildings on trees, etc). * <confluence> We should have text images instead of buttons (in the various menus and toolbars). -* Persistent high scores - -* Better fox move logic - - Tweak weighting of free chickens - - Foxes should eat the chickens immediately when they move onto the - occupied square - avoid the fox drawn on top of chicken thing. - -* More game levels / progression of difficulty - -* Improve performance when many foxes or chickens - * Improve Fullscreen mode (on the fly scaling) * Investigate using infinity symbol instead of dash for unlimited mode == ISSUES == -23:26 <@Derakon> Jerith: http://paste.ubuntu.com/266865/ -23:26 <@Derakon> That's with the OSX .dmg. - -From the pastebin URL above: """ -dyld: lazy symbol binding failed: Symbol not found: _pthread_cond_init$UNIX2003 - Referenced from: /Volumes/Operation Fox Assault/Operation Fox Assault.app/Contents/Frameworks/libpython2.5.dylib - Expected in: /usr/lib/libSystem.B.dylib - -dyld: Symbol not found: _pthread_cond_init$UNIX2003 - Referenced from: /Volumes/Operation Fox Assault/Operation Fox Assault.app/Contents/Frameworks/libpython2.5.dylib - Expected in: /usr/lib/libSystem.B.dylib - -Sep 7 14:25:21 Kleine crashdump[402]: Operation Fox Assault crashed -Sep 7 14:25:21 Kleine crashdump[402]: crash report written to: /Users/chriswei/Library/Logs/CrashReporter/Operation Fox Assault.crash.log -""" - -pygame event queue full bug. -Sep 10 22:01: <eltigre> one IndexError and one pygame event overflow -... -Sep 10 23:15: <eltigre> Hodgestar, jerith : http://dpaste.com/91590/ - -From pastebin: -""" -Traceback (most recent call last): - File "run_game.py", line 4, in <module> - main.main() - File "/home/andi/projekte/pyweek/Rinkhals/foxassault-1.0.0/gamelib/main.py", line 38, in main - engine.run(MainMenuState(engine), screen) - File "/home/andi/projekte/pyweek/Rinkhals/foxassault-1.0.0/pgu/engine.py", line 104, in run - self.loop() - File "/home/andi/projekte/pyweek/Rinkhals/foxassault-1.0.0/pgu/engine.py", line 123, in loop - if self.fnc('event',e): return - File "/home/andi/projekte/pyweek/Rinkhals/foxassault-1.0.0/pgu/engine.py", line 79, in fnc - if v != None: r = f(v) - File "/home/andi/projekte/pyweek/Rinkhals/foxassault-1.0.0/gamelib/engine.py", line 229, in event - return pygame.event.post(START_DAY) -pygame.error: Event queue full -""" - - r370 disables timer events while processing the fox movements and - chicken attacks. This should make this bug harder to trigger. - - Leaking weakref objects bug (reported by tumbleweed): - this is probably http://pygame.motherhamster.org/bugzilla/show_bug.cgi?id=30 @@ -73,39 +20,9 @@ Farmer's weekly (daily?) -- egg/chicken/fox report thing. (Yay Marc!) -23:41 <@Derakon> The instructions could also be more detailed, but the game's pretty intuitive once you realize that it's not realtime. -00:03 < Rhamphoryncus> hrm. Instructions need work.. yup, that got said, heh - -00:10 <@Derakon> An auto-repair fences command would be handy. -00:12 <@Derakon> Man, fence repair is nuking my budget. -00:13 <@AnnoDomini> Fences made of wood are overrated. -00:13 <@AnnoDomini> I make a fence of elite fighting fowl. -00:13 * Derakon nods. -00:15 <@Derakon> Suddenly the game gets much easier~ - -00:28 <@Derakon> I want a faster way to sell eggs. ._. -00:29 <@Derakon> Some way to say "Keep enough eggs to mature the maximum number of chickens as quickly as possible; sell the rest." -00:33 <@jerith> Derakon: Superfluous eggs autosell. -00:34 <@jerith> A chicken lays some number of eggs. On of those eggs will hatch, the rest will sell. -00:34 <@Derakon> Oooh. -00:34 <@Derakon> Okay, then I can stop bothering to click so much. Thanks. - -00:38 <@AnnoDomini> Needs an 'evict all' button. - 00:40 <@Derakon> And a way to drag-clear trees, drag-sell chickens (or auto-sell naked outdoor chickens). 00:42 <@Derakon> So...much...clicking... ;.; -00:50 <@AnnoDomini> http://i30.tinypic.com/sx15k1.jpg - -01:19 < Rhamphoryncus> Do you know what watch towers are for? -01:20 <@Derakon> I think the watchtowers might make riflehens more effective somehow. -01:20 <@Derakon> Or maybe they're bunkers. - -01:24 < Rhamphoryncus> And I have no idea what my income is from -01:24 <@Derakon> Killing foxes and selling stuff. -01:25 < Rhamphoryncus> I have spare room around my henhouses, so autosell isn't happening. It must be from killing foxes -01:27 <@AnnoDomini> Rhamphoryncus: I expect you get eggs sold. Hens lay eggs every turn, but incubate for two. So you get N*5 cash for each hen in a henhouse/hendominium per turn. - 01:31 < Rhamphoryncus> It seems like, long term, you want to pack hendominiums in with no space around them 01:32 < Rhamphoryncus> As you fill a grid like that you'll still have exposed edges, producing tons of chickens 01:32 <@AnnoDomini> Aren't overflow chickens autokilled, rather the eggs never hatching and being sold? @@ -114,23 +31,11 @@ 01:33 < Rhamphoryncus> I thought they were autosold. I may have been confusing with the egg autosell though 01:33 <@AnnoDomini> Eggs autosell if there's no room. Chickens die. -05:41 <@Derakon> 2x2 pods of knifehens are almost invincible. -05:57 <@Derakon> Oh, hey, the 2x2 pod of knifehens is not invulnerable. The foxes finally killed one after losing some 1500 of their own. - -05:45 * Vornicus-Latens thinks this game needs less shouty graphics. - 08:37 < Rhamphoryncus> jerith: feature request: automatically switch to an offset breeding schedule. IOW, a henhouse should only do 3/day and a hendemonium should only do 6/day 08:50 < Rhamphoryncus> and if I go and sell an egg in a henhouse/hendominium, is it supposed to take multiple clicks? [ed: He didn't know it was multiple eggs.] -09:12 < Reivthia> Jerith: UI improvement: *Please* let us click&drag. -09:12 < Reivthia> I want to be able to not have to click every single chicken/tree seperately when I have five thousand cash :P - -09:12 < Rhamphoryncus> My huts get ignored -09:12 < Reivthia> Rham: I thought mine were too, until they got occasionally pounced. -09:12 < Reivthia> Very, very occasionally - And here's me rapid-fire rambling at #ctpug after finishing my first long game. (Unedited.)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/icons/easter_egg.svg Sat Nov 28 23:14:13 2009 +0000 @@ -0,0 +1,120 @@ +<?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" + width="525" + height="525" + id="svg2" + sodipodi:version="0.32" + inkscape:version="0.46" + version="1.0" + sodipodi:docname="easter_egg.svg" + inkscape:output_extension="org.inkscape.output.svg.inkscape"> + <defs + id="defs4"> + <linearGradient + id="linearGradient3197"> + <stop + style="stop-color:#ffffff;stop-opacity:1;" + offset="0" + id="stop3199" /> + <stop + style="stop-color:#ffffff;stop-opacity:0;" + offset="1" + id="stop3201" /> + </linearGradient> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient3197" + id="radialGradient3205" + cx="293.67725" + cy="647.4093" + fx="293.67725" + fy="647.4093" + r="67.109756" + gradientTransform="matrix(0.7086974,-0.2004245,0.2817928,0.996415,-139.75482,21.242668)" + gradientUnits="userSpaceOnUse" /> + <inkscape:perspective + sodipodi:type="inkscape:persp3d" + inkscape:vp_x="0 : 526.18109 : 1" + inkscape:vp_y="0 : 1000 : 0" + inkscape:vp_z="744.09448 : 526.18109 : 1" + inkscape:persp3d-origin="372.04724 : 350.78739 : 1" + id="perspective10" /> + <inkscape:perspective + id="perspective2447" + inkscape:persp3d-origin="372.04724 : 350.78739 : 1" + inkscape:vp_z="744.09448 : 526.18109 : 1" + inkscape:vp_y="0 : 1000 : 0" + inkscape:vp_x="0 : 526.18109 : 1" + sodipodi:type="inkscape:persp3d" /> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + gridtolerance="10000" + guidetolerance="10" + objecttolerance="10" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="0.71788174" + inkscape:cx="293.0588" + inkscape:cy="332.94121" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="false" + inkscape:window-width="1280" + inkscape:window-height="735" + inkscape:window-x="0" + inkscape:window-y="24" /> + <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" /> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(-169.70945,-261.08105)"> + <g + id="g3227" + transform="matrix(2.697649,1.8419295,-1.8419295,2.697649,760.29053,-1588.1876)"> + <path + sodipodi:nodetypes="cccccccccc" + id="path3257" + d="M 272.57885,672.08213 C 261.14207,670.44224 244.50354,660.83594 238.76407,653.25966 C 217.2754,632.03519 211.41013,599.2264 217.28901,570.42198 C 222.21534,549.80906 233.42293,530.24167 250.01452,516.85795 C 263.0509,506.08194 281.77872,501.65281 297.68863,508.44434 C 315.27504,515.84578 329.41138,530.35956 338.53279,546.91624 C 347.78459,565.83332 350.87324,587.59541 348.68668,608.46146 C 347.21164,622.69079 340.21868,635.63088 332.50999,647.40007 C 319.29799,664.41174 297.37053,675.2111 275.65676,672.46685 C 274.62705,672.37201 273.59897,672.25277 272.57885,672.08213 z" + style="fill:#003aff;fill-opacity:1" /> + <path + sodipodi:nodetypes="cccccccccc" + id="path3191" + d="M 262.45442,598.06126 C 254.79567,609.94913 250.36482,625.06491 246.41364,640.66036 C 233.9586,629.43438 223.73231,614.96658 215.25451,597.95552 C 212.90153,558.81344 233.34167,530.03483 250.01452,516.85795 C 263.0509,506.08194 281.77872,501.65281 297.68863,508.44434 C 315.27504,515.84578 329.41138,530.35956 338.53279,546.91624 C 347.78459,565.83332 354.13462,599.73149 344.75332,624.19491 C 339.20749,613.61338 334.31921,598.22017 324.50669,589.77199 C 315.31871,610.81551 299.92356,631.62908 286.23117,648.1682 C 277.39359,631.76988 267.32076,615.78332 262.45442,598.06126 z" + style="fill:#faff00;fill-opacity:1" /> + <path + sodipodi:nodetypes="cccccccccc" + id="path3193" + d="M 266.50419,567.46297 C 255.77033,583.24306 247.09809,599.90669 240.56397,617.48666 C 229.56884,602.97545 221.685,587.33287 217.28901,570.42198 C 222.21534,549.80906 233.42293,530.24167 250.01452,516.85795 C 263.0509,506.08194 281.77872,501.65281 297.68863,508.44434 C 315.27504,515.84578 329.41138,530.35956 338.53279,546.91624 C 347.78459,565.83332 350.87324,587.59541 348.68668,608.46146 C 339.97176,594.8974 333.27536,578.32841 319.87822,567.69074 C 313.54783,586.54304 300.6307,604.9382 289.60598,620.26976 C 280.04355,603.41223 270.23559,586.65291 266.50419,567.46297 z" + style="fill:#ff0600;fill-opacity:1" /> + <path + sodipodi:nodetypes="cccccccccc" + id="path3195" + d="M 272.57885,672.08213 C 261.14207,670.44224 244.50354,660.83594 238.76407,653.25966 C 217.2754,632.03519 211.41013,599.2264 217.28901,570.42198 C 222.21534,549.80906 233.42293,530.24167 250.01452,516.85795 C 263.0509,506.08194 281.77872,501.65281 297.68863,508.44434 C 315.27504,515.84578 329.41138,530.35956 338.53279,546.91624 C 347.78459,565.83332 350.87324,587.59541 348.68668,608.46146 C 347.21164,622.69079 340.21868,635.63088 332.50999,647.40007 C 319.29799,664.41174 297.37053,675.2111 275.65676,672.46685 C 274.62705,672.37201 273.59897,672.25277 272.57885,672.08213 z" + style="fill:url(#radialGradient3205);fill-opacity:1" /> + </g> + </g> +</svg>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/sprites/equip_easter_egg.svg Sat Nov 28 23:14:13 2009 +0000 @@ -0,0 +1,130 @@ +<?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" + width="525" + height="525" + id="svg2" + sodipodi:version="0.32" + inkscape:version="0.46" + version="1.0" + sodipodi:docname="equip_easter_egg.svg" + inkscape:output_extension="org.inkscape.output.svg.inkscape"> + <defs + id="defs4"> + <linearGradient + id="linearGradient3197"> + <stop + style="stop-color:#ffffff;stop-opacity:1;" + offset="0" + id="stop3199" /> + <stop + style="stop-color:#ffffff;stop-opacity:0;" + offset="1" + id="stop3201" /> + </linearGradient> + <linearGradient + id="linearGradient3183"> + <stop + style="stop-color:#b4875b;stop-opacity:1;" + offset="0" + id="stop3185" /> + <stop + style="stop-color:#001ddc;stop-opacity:1;" + offset="1" + id="stop3187" /> + </linearGradient> + <inkscape:perspective + sodipodi:type="inkscape:persp3d" + inkscape:vp_x="0 : 526.18109 : 1" + inkscape:vp_y="0 : 1000 : 0" + inkscape:vp_z="744.09448 : 526.18109 : 1" + inkscape:persp3d-origin="372.04724 : 350.78739 : 1" + id="perspective10" /> + <inkscape:perspective + id="perspective2447" + inkscape:persp3d-origin="372.04724 : 350.78739 : 1" + inkscape:vp_z="744.09448 : 526.18109 : 1" + inkscape:vp_y="0 : 1000 : 0" + inkscape:vp_x="0 : 526.18109 : 1" + sodipodi:type="inkscape:persp3d" /> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient3197" + id="radialGradient3205" + cx="293.67725" + cy="647.4093" + fx="293.67725" + fy="647.4093" + r="67.109756" + gradientTransform="matrix(0.7086974,-0.2004245,0.2817928,0.996415,-139.75482,21.242668)" + gradientUnits="userSpaceOnUse" /> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + gridtolerance="10000" + guidetolerance="10" + objecttolerance="10" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="1.0057143" + inkscape:cx="262.5" + inkscape:cy="262.5" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="false" + inkscape:window-width="1278" + inkscape:window-height="730" + inkscape:window-x="0" + inkscape:window-y="24" /> + <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" /> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(-169.70945,-261.08105)"> + <g + id="g3227"> + <path + sodipodi:nodetypes="cccccccccc" + id="path2503" + d="M 272.57885,672.08213 C 261.14207,670.44224 244.50354,660.83594 238.76407,653.25966 C 217.2754,632.03519 211.41013,599.2264 217.28901,570.42198 C 222.21534,549.80906 233.42293,530.24167 250.01452,516.85795 C 263.0509,506.08194 281.77872,501.65281 297.68863,508.44434 C 315.27504,515.84578 329.41138,530.35956 338.53279,546.91624 C 347.78459,565.83332 350.87324,587.59541 348.68668,608.46146 C 347.21164,622.69079 340.21868,635.63088 332.50999,647.40007 C 319.29799,664.41174 297.37053,675.2111 275.65676,672.46685 C 274.62705,672.37201 273.59897,672.25277 272.57885,672.08213 z" + style="fill:#003aff;fill-opacity:1" /> + <path + sodipodi:nodetypes="cccccccccc" + id="path3191" + d="M 262.45442,598.06126 C 254.79567,609.94913 250.36482,625.06491 246.41364,640.66036 C 233.9586,629.43438 223.73231,614.96658 215.25451,597.95552 C 212.90153,558.81344 233.34167,530.03483 250.01452,516.85795 C 263.0509,506.08194 281.77872,501.65281 297.68863,508.44434 C 315.27504,515.84578 329.41138,530.35956 338.53279,546.91624 C 347.78459,565.83332 354.13462,599.73149 344.75332,624.19491 C 339.20749,613.61338 334.31921,598.22017 324.50669,589.77199 C 315.31871,610.81551 299.92356,631.62908 286.23117,648.1682 C 277.39359,631.76988 267.32076,615.78332 262.45442,598.06126 z" + style="fill:#faff00;fill-opacity:1" /> + <path + sodipodi:nodetypes="cccccccccc" + id="path3193" + d="M 266.50419,567.46297 C 255.77033,583.24306 247.09809,599.90669 240.56397,617.48666 C 229.56884,602.97545 221.685,587.33287 217.28901,570.42198 C 222.21534,549.80906 233.42293,530.24167 250.01452,516.85795 C 263.0509,506.08194 281.77872,501.65281 297.68863,508.44434 C 315.27504,515.84578 329.41138,530.35956 338.53279,546.91624 C 347.78459,565.83332 350.87324,587.59541 348.68668,608.46146 C 339.97176,594.8974 333.27536,578.32841 319.87822,567.69074 C 313.54783,586.54304 300.6307,604.9382 289.60598,620.26976 C 280.04355,603.41223 270.23559,586.65291 266.50419,567.46297 z" + style="fill:#ff0600;fill-opacity:1" /> + <path + sodipodi:nodetypes="cccccccccc" + id="path3195" + d="M 272.57885,672.08213 C 261.14207,670.44224 244.50354,660.83594 238.76407,653.25966 C 217.2754,632.03519 211.41013,599.2264 217.28901,570.42198 C 222.21534,549.80906 233.42293,530.24167 250.01452,516.85795 C 263.0509,506.08194 281.77872,501.65281 297.68863,508.44434 C 315.27504,515.84578 329.41138,530.35956 338.53279,546.91624 C 347.78459,565.83332 350.87324,587.59541 348.68668,608.46146 C 347.21164,622.69079 340.21868,635.63088 332.50999,647.40007 C 319.29799,664.41174 297.37053,675.2111 275.65676,672.46685 C 274.62705,672.37201 273.59897,672.25277 272.57885,672.08213 z" + style="fill:url(#radialGradient3205);fill-opacity:1" /> + </g> + </g> +</svg>
--- a/gamelib/main.py Sat Nov 28 22:55:30 2009 +0000 +++ b/gamelib/main.py Sat Nov 28 23:14:13 2009 +0000 @@ -10,13 +10,14 @@ import pygame from pgu import gui -from pygame.locals import SWSURFACE +from pygame.locals import SWSURFACE, SRCALPHA #from engine import Engine, MainMenuState from sound import init_sound import constants from config import config import data +from misc import WarnDialog def create_main_app(screen): """Create an app with a background widget.""" @@ -26,10 +27,32 @@ app.init(widget, screen) return app +def complaint_dialog(message): + """Create a complaint dialog""" + app = gui.App() + + def close(_w): + app.quit() + + app.close = close + + dialog = WarnDialog('Problem starting Fox Assault', + message) + app.run(dialog) + sys.exit(1) + +def sanity_check(): + """Run some sanity checks, and complain if they fail""" + try: + pygame.Surface((100, 100), flags=SRCALPHA) + except Exception, e: + complaint_dialog("Unable to create a suitable screen, please check your display settings") + def main(): """Main script.""" config.configure(sys.argv[1:]) init_sound() + sanity_check() screen = pygame.display.set_mode(constants.SCREEN, SWSURFACE) pygame.display.set_icon(pygame.image.load( data.filepath('icons/foxassault24x24.png')))