Wrote a Tile system!

Welcome back! I’m very happy to be working on the game again, after the brief hiatus. I made a grid system, as shown below. Here’s the latest thing little app I made, the colors and text is all just there for making the tiles visible, otherwise it’d be a blank screen :

Hit the jump for code examples, and what my old broken version of the code was.

(more…)

Particle Simulator

Back from the break.

I decided to downgrade my project once again, because I guess my steps weren’t of a baby sized variation. In case you’re keeping track, it’s gone from the world’s best Python Roguelike, to a top down shooter, to a pong clone, and now finally, a particle simulator! I’m pretty sure this is a normal progression, because all it means is I’m learning what I’m capable of.

So anyways, I’m looking to create a simple physics simulator to fool around with, and I got stuck on what was a simple case of not using the right variables. Typical stuff, and then tonight I got stuck on inter-particle collisions, because once I got the wall collisions working I felt pretty good about it. Little did I know, life was going to get more complicated.

Pretty much we’re back to the beginning with the endless wall bouncing, and I’m not sure why exactly. The thing that seemed to cause it, is I’m resetting the list that contains all the rects of the particles, but as far as I know, the only thing that needs to use that list is the collision functions. The reason I wanted to reset that list every frame was just because I wasn’t updating the rects in it, so every collision test was testing against the original positions of the particles. Empyting and re-filling it every frame seemed to do the trick at first, but in the end, it seems like it didn’t really help at all.

Oh well, another night I’ll work through it and get it nice and functioning.

On another note, I’m going to try to write at least 200 words 3 times a week in order to build up my writing chops, and hopefully get a bit of a helping crowd going.

Talk to you Thursday!