Pac-Bat

Hi,

I made a thing. I had these 360-degree pictures of my friends in Batman-themed costumes, and I wanted to do something fun with them, so I took a Python-based Pac-Man game (from pinproject.com/pacman/pacman.htm ), spent an afternoon adapting it to Panda3D, and made something the world hasn’t seen before.

I think it’s kind of funny. Check it out at ddrose.com/pacbat/pacbat.zip .

David

this is the first pacman game that actually made ma laugh :smiley: great job.

Actually it’s a curious Pacman! :slight_smile: I found that you’ve to escape from women a bit counterintuitive. :slight_smile: Why didn’t you enable the transparency on the sprites?

Ah, but they’re evil women! Actually, Batman is not so good at escaping these particular women in the comics either.

There was no alpha mask on these images, so there is no transparency to be enabled. They were just photographs of people in costume against a white wall. With some effort, I suppose it would be possible to extract out the characters independently from the white wall, but that would be a substantial effort. Besides, I think it’s funnier to leave them as they are.

David

Would it be OK to ask questions about the code? Reading it right now.

What I don’t get are those continueXYZ functions for the FSM:

 def continueAfterFinishing(self, task):
        self.request('FlashingMaze')

This is not something that the FSM really works with by design, right? That’s just good coding practise? Good to read? I’m asking because FSM are in my game all over the place.

And if it’s a task, why is there no return task.cont or return task.again?

In def setTargetHeading(self, h): you are using an interval that would run only for a frame to set the heading. I’ve seen you do this before. Is this comparable to a task setting the position every frame?

continueAfterFinishing() is a function of my own naming. It has nothing to do with FSM conventions or any other established conventions. I wouldn’t attempt to say whether it represents good practice or not. It is called via doMethodLater() to change the FSM from state Finishing to another state after a fixed amount of time; thus the name. Because it’s called by doMethodLater, it is technically a task function, so it receives a task parameter; but it is not intended to run repeatedly, so it doesn’t return task.cont or task.again. (It arguably ought to return task.done to make its intention to terminate after running once explicit, but this is the same thing that happens if you don’t return anything, so I didn’t bother.)

The interval spawned in setTargetHeading() will run over several frames. (I can’t think of any reason right now to spawn an interval that only runs for one frame.) It has a duration in seconds calculated in the variable ‘duration’. The purpose of this interval is to smoothly rotate the character to face the desired direction, rather than simply ‘popping’ it there.

David

I made about 13k. Try to beat that! :smiley:

Really, a very nice idea and well implemented.
I especially liked the last line of the credits.

Will look into the code another time.

Thanks!

Ok, this is cool! You should extend it into a facebook app/game where people face off against their friends profile pictures…

Does anyone have the source code? The link is broken :frowning: if anyone had a mirror or could send it to me i’d greatly appreciate it thank you!