The Road to PyWeek - A Favorite Toy and Another Game

I've started on my next warmup game. Well, technically not a PyWeek warmup proper, but it's a game nonetheless.

I've given myself until 5PM (EST) on the 28th to finish a physics platformer with Inkscape levels.

I'll be using Pymunk for the physics, and Squirtle for SVGs functionality. Baddies and many props will be physics-enabled, as will the player. All physical props will be created in the level file, and the level file will contain funky layers for fancy things like... Well just about anything I can get Pymunk to do in that short span of time.

The premise (At least gameplay-wise) is that the player is a little bouncy ball sort of creature that can roll around and bounce. (Two things which don't sound far-fetched for a bouncy ball to do, I think) In addition, the player can jump a bit and affect their elasticity. Normally, the player bounces a bit, but not much, but when holding the "bounce" key, they become very bouncy and actually gain a bit of speed when they bounce off of things.

Baddies take damage depending on forces they are subject to, and all baddies have a minimum force below which they take no damage whatsoever. Some baddies are able to fly, and will fall a bit when hit hard enough.

There will be two playable characters again. A female character who is very light (Less damage to baddies) but bounces higher, and a male character who is very heavy but doesn't bounce as high. These two probably won't be as radically different as Rachel and Jack from GunFox.

I'm hoping to have something to demonstrate physics-wise by Friday.


Here's hoping...

---Akake

(log in to comment)

Comments

Sounds quite technically involved. Good luck!

I liked GunFox, by the way.
Akake - if it's any help I have a version of Squirtle that lets you create levels with layers in Inkscape.
(grab the squirtle module from my PyWeek 9 game if you want it)
richard: I've picked up a copy of it, and am going to use it.

One question, though: What SVG format do I export from Inkscape?

I've tried using Inkscape SVGs, but I get exceptions for unrecognized opcodes, and I've tried plain SVGs but those don't have layers.

I'd really appreciate some help.

--Akake
I never exported, just saved and used the saved file. Hmm. I'm not sure what Inkscape generates that Squirtle doesn't handle. Might be text? Or a particular type of gradient?

Dunno. Try something simple and work up from there :)

Maybe have a look at the SVG files from my game.
It seems to be having trouble with paths. Inkscape seems to be writing path data that Squirtle doesn't like.

For example, where squirtle expects a capital M, Inkscape prints a lowercase one, and where Squirtle expects a character between pairs of coordinates, Inkscape simply strings pairs of coordinates together with nothing between.

To be honest, I'm not doing anything fancier than some simple paths at the moment, and I'm a bit frustrated with this problem. :(
I've looked at your levels, and their path data looks very different from what I'm getting when I save my file... I'm really confused at this.
Akake: Can you give us an example SVG? Squirtle has usually managed inkscape path data just fine...
Apparently the 'm' opcode was left out. You can add this in the appropriate section of SVG.parse_element:

elif opcode == 'm':
    mx, my = self.x, self.y
    x1, y1 = pnext()
    self.set_position(mx + x1, my + y1)
Thanks, Chard!