So what I was recently having some trouble with was with Python’s PyGame Rotate function. I was having trouble understanding what some of from the comments found here meant, or were trying to illustrate, let alone the documentation given, so I resolved to figure it out , once and for all, so hopefully this post will be enough to get someone else on track. I think I was getting caught up on the different ways to deal with blitting and surfaces and rects.
I guess I got a bit hasty, and instead of doing the responsible thing, I just erased some complicated forward thinking functions I had implemented, and now everything is going to be dealt with as if it was normalized. I had to change a bunch of code, but the entire code base is still less than 1k lines, so it wasn’t too too bad.
Currently trying to integrate a new window/frame with tkinter so I can monitor certain stats, debug or otherwise, without printing ’em. Hopefully I’ll figure it out, otherwise I’m sure pyGame has some sort of window option.
Alright, so I’m at a point where I’ve begun showing it off to a few friends. It’s cool enough to see for my first project. It’s got just enough to be a minimal app. It’s basically moving and shooting still targets now.
What I’ve got is :
Basic movements down with mouse and KB+KP
Shooting with hit detection. Plus shrapnel streams off the side in a perpendicular way.
Can change sprite, I call frame, on the fly with 0-9 keys, if you hit an enemy, they cycle through the frames I’ve got made.
FPS is shown at the stop, but I took that from someone else, but it’s a fairly basic:
Turns out the .jpg compression was throwing in some odd pixels even at 100% quality, now I’m using PNGs.
Anyways, my latest victory was using the A* wiki page as an example and making a working, slow, pathfinder! Here’s the script for a working model, but it’s dirty as all hell. I’m really proud of it, the biggest hurdle was obviously learning A*, and what heuristics and admissible were and all that. After that though, it was tough just turning the pseudocode into python, but I got there!
Now I just gotta use that binary heap to speed it up, and I can move up the scale!