It had nothing to do with slopes after all. It turns out I had the “receive physics” box checked, and every time the bad guys ran into a wall, they would turn around and bounce off in slow motion, which looked a lot like flying.
I ended up completely redoing the enemy’s collision detection, using Pickline to check the entire bottom edge (with a 3 pixel buffer) to see if he was intersecting anything solid.
Also, because of all this, I ended up discovering that the entire time, I’d been using the width and height of the image instead of the collision polygon, which doesn’t matter so much for Tim, but matters a whole bunch for the caveman, who has a bunch of transparent space around him. I ended up discovering how to translate coordinates from object space to world space, and now all my calculations are a lot more accurate.
I also ended up playing around with collision layers, so now the caveman doesn’t end up standing on top of Tim’s head, and if there are multiple cavemen on the screen, they don’t push each other around trying to get to Tim.
I’ve started adding the code necessary to make the enemies modular; ideally, all I do is add a field to each enemy sprite that holds the name (Thug, KnifeThug, Samurai, etc.) and the enemyclass initialization does the rest, changing all the applicable variables as necessary (health, damage, range, etc. Fun Fact: I’ve added a variable called fernkampf as a mini-homage to Albion, which was originally coded in german. Fernkampf means long-range-combat and that was the variable name that held the amount of damage different characters did).
I’m going to start needing some enemy animations here soon; just a way to differentiate between different types. What I used on deployment was just a single image that scrolled an animated marquee across the top: “attacking,” “walking,” or “idle.” I would change the color of shirt and pants to make the enemies look different. That’s pretty cheesy, but it worked for the time. Now that I’m using better quality graphics, though, I’d kind of like everything to be a little better looking. There has to be an application out there somewhere for animating simple characters.