Bouncy
Awards
Scores
Ratings (show detail)
Overall: 3.3
Fun: 3.4
Production: 3.4
Innovation: 3.3
0% of respondents wished to disqualify the entry.
Respondents: 22
Files
File | Uploader | Date |
---|---|---|
Bouncy_screenshot_2007-08-09.png
screenshot from the final version |
viblo | 2007/09/09 10:54 |
Bouncy-1.2.zip
— final
final entry |
viblo | 2007/09/09 10:51 |
bouncy_2007-09-08.png
Made some great progress today: I added a help screen! Now I only have to fill it with my wisdom ;-) |
viblo | 2007/09/08 00:52 |
Bouncy_2007-09-05.png
Today I worked on my own and implemented a menu (and fixed our state system, but that is not visible in the screenshot). As you can see the menu has super high quality graphics :) |
viblo | 2007/09/05 21:25 |
Bouncy_2007-09-04.png
Day 3. Feels more like a game today. |
viblo | 2007/09/04 21:17 |
bouncy_screenshot_2007_09_03.png
2 days of work.. :) |
viblo | 2007/09/03 21:15 |
Diary Entries
Chipmunk 2d physics lib
In the same spirit as Hectigo and tsmaster, I have now with this post released a small library called pymunk just for pyweek! :)
Chipmunk is a 2d physics engine written in C, and can be found here: Chipmunk.
pymunk is a low level binding made with ctypes, so you can now use Chipmunk in your Python code!
The link: pymunk-0.1.zip
And a screenshot from the included demo:And a cut-n-paste from the readme:
pymunk - pyweek5 edition========================
2007, Victor Blomqvist - vb@viblo.se
ABOUT
pymunk is a wrapper around the 2d physics library Chipmunk
(http://wiki.slembcke.net/main/published/Chipmunk).
At the moment, its an autogenerated ctypes binding + a modified version
of the vector2d cookbook-snippet from pygame.org at
(http://www.pygame.org/wiki/2DVectorClass)
HOW TO USE
There is no specific pymunk documentation yet except for this readme.
However, The Chipmunk docs should be more or less enough together with ctypes,
as pymunk is just a very low level ctypes binding at the moment.
Chipmunk documentation can be found here:
http://files.slembcke.net/chipmunk/chipmunk-docs.html
EXAMPLE
See demo1.py for an example of how easy it is to use! :)
DEPENDENCIES/REQUIREMENTS
* A windows-dll of Chipmunk (or a *nix-library if you are on *nix). See COMPILE
for compile-instructions. The dll/lib should be placed somewhere where pymunk
can find it. A safe bet should be in the same folder, at least on Windows ;)
pymunk uses the source from Chipmunk SVN revision 125.
* ctypes (included in python 2.5)
COMPILE
If you are on a platform other than windows, you will have to build Chipmunk
on your own. It should be no problem, the source is included in the
Chipmunk_src folder.
> gcc -O3 -std=gnu99 -ffast-math -c *.c
> gcc -shared -o libChipmunkPyEd.so *.o
or run build.sh (untested!) to compile.
The output should be placed somewhere pymunk can find it.
THE FUTURE
I have plans to do a more high-level/pythonic wrapper in the future, and even
started a little. But the pyweek library release stop is today(! or tomorrow?),
so the low-level stuff had to do for now.
End of day 2 - We might know what to do now
After playing with Chipmunk/pymunk and QGL yesterday and trying to put together some base code (and figuring out what to do) we put together something more game-like today. Just take a look at the nice screenshot in the bottom of this post! Bouncing balls, red squares, a green arrow and "twisters". Sure looks like a twisted game! ;)
Today we also learned to not set the shape id in code (shape.contents.id), and certainly not set the id so several shapes shared a single one (wow, that bug took a loong time to find). Otherwise the physics seem to work ok for our needs.
btw, are we the only entry using QGL? Its a small OpenGL scenegraph found here: http://pypi.python.org/pypi/QGL/9
Trouble running Bouncy on Linux?
The instructions in the readme seems to be a bit unclear on what you need to do to run Bouncy under Linux, so if you have trouble in running Bouncy under linux and it complains about a .dylib file not found, read on!
You will need to compile chipmunk. It is not very hard to do:
- Unzip the pymunk-0.1.1.zip file included in the Bouncy zip. It contains Chipmunk (and pymunk, the python binding, but we only need to compile chipmunk for Bouncy to run).
- Go to the folder named Chipmunk_src
-
Compile!
> gcc -O3 -std=gnu99 -fPIC -ffast-math -c *.c
> gcc -shared -o libChipmunkPyEd.so *.o - Move libChipmunkPyEd.so to /usr/lib
- The game should work now.
Crash-bug in Bouncy
Some players complained about a KeyError exception, at "del self.shape_to_actor_map[s.contents.id]" in the destroyActor fuction. If you get this error (I havent been able to reproduce it myself) you can fix it with a small try-except-block. Replace line 248 in ActorManager.py in the following way:
before:del self.shape_to_actor_map[s.contents.id]after:
try: del self.shape_to_actor_map[s.contents.id] except: pass
Gamedev Four Elements VI
Four Elements (or "4E," as many of us call it) is GameDev.net's biggest annual competition, running for about half a year. We give you four "elements," and you go off and make a game based around them.It runns from "September 27, 2007, at 1000 hours CDT" to "April 3, 2008, at 2300 hours CDT" and the elements (aka pyweek-theme) are Ponies, Accountants, Crystals and Explosions. Even if the competition runns for half a year, it should be possible to put toghether a cool game in a week or so, right? Anyway, it would be cool if there were more python games in the competition..