I got a lot done today and yet I didn’t, it’s strange how that works 😛
Most of my time was spent working on enemy-related stuff. I started by implementing the bee idea I had yesterday. I wanted to give an object a more complex movement pattern, so I used this bee thing as a test.
Basically, my idea was that sometimes when you hit the sunflower things, a bee will pop out and chase you, kind of like the bees in Zelda 3. I wound up eventually making them enemies, that way you can kill them after they pop out.
Using the info from helpful commenters, I was able to get the hang of unit vectors, so I used that to implement the bee. It will chase you for a while, but if you get out of range it’ll just instead circle around. Figuring out how to get the trig for that working was fun too, it took me back to my old high school days when I’d do all kinds of wacky graphics stuff using trig and equations (which was the basis for the graphics in Tomato Boxes, incidentally).
After some work, I got the bees functioning properly, it’s so nice to see it working exactly as planned 😀
Worried that I’d end up spending the entire day on a stupid bee, I decided to finally get REALLY crazy with enemy actions by implementing a boss character. I wanted a big slime ball thing to jump into the air and back down, so Poe drew up some really cool sprites and I got to it, starting with two new rooms for this test engine.
First impression – holy crap is programming boss stuff hard! It’s definitely going to take me a while to get the hang of this. It’s like completely uncharted territory for me, trying to come up with complex actions – even just simple complex actions like jumping back and forth and taking time to blink after landing once in a while.
After a lot of hijinks I was able to get some sort of movement going, but nothing like what I’m hoping for. So it’s going to take some time to get this boss down right.
I did make it so that the boss blows up in smoke while flashing, and then leaves behind a bunch of coins and power pellets. I always wondered how that was done in SNES games and later, now I know! It wasn’t too hard, although I don’t know if reusing the “enemy appearance” cloud for the explosions fits well.
Zelda 1 has really simple boss actions, almost laughable in a way. I’ve already implemented about that same level, but I want the bosses in this eventual game (which probably won’t look anything like this test engine) to have more complex actions. I don’t wanna play a game with boss enemies that are as dumb as the regular enemies, you know?
I’ve also learned that it’s really easy to make a boss hard, but really hard to make a boss that’s just the right level of difficulty and fun. Gonna have to ponder this some more!
So right now the boss works but is very tough to beat. And its actions still need a lot of work. But it’s in there!
For fun I added in another Zelda 1 song. I feel it helps me stay focused so I don’t stray too far from Zelda-ish stuff while doing all the coding.
Because the boss is a different size than the rest of the enemies, and because some of its frames don’t take up the entire sprite area, I had to write some stuff to make different hit boxes for different frames. To test this out, I have the ability to display enemy hitboxes. It’s nothing special, but kind of neat in a dev watching sort of way:
Thoughts and Stuff
Enemy actions are tough 😯 I’m going to have to think about how to simplify it and make come up with some sort of simple scripting system. This is probably why a lot of people use Python and stuff, I’ve never learned it though. Maybe someday.
Probably the biggest unexpected lesson of the day was that suddenly sprite priority is a big issue. When bees come out, you don’t see them right away because they’re covered by the flower sprites. And theoretically, right now the tomato will cover the boss’s sprite while it flies around, although you can’t see it because you get knocked back. I’m going to have to fix these things at some point. I tried earlier today but got some really, really crazy results. Another day perhaps.
I tried playing the game in full screen today, but was aghast when I realized that XNA will stretch the image to fit the entire screen. This squished and stretched everything really weirdly. I think I know how to fix this, it won’t be pretty and it might mean some people will have black bars on the sides while in full screen. But maybe that’s the norm these days, I don’t really know.