Posts tagged Collisions
I’ve been coming to grips with the fact that the enemy movement is not precisely as simple as I thought it would be. That said, I have got a pretty nice enemy that flies around above you without too much work, but the movements are not yet smooth, and it’s a bit weird because I’m applying forces to a physics object rather than simply updating position. It also doesn’t try to attack yet, and I also haven’t implemented the collision stuff that will handle damage and other effects of collision, but that shouldn’t be too difficult. I will be looking around online for different techniques to approach the enemy movement with and see if there are any good ones I should know about.
I also still need to implement projectiles for killing the enemy with. In its current state, the enemy won’t be easily shot unless it is trying to attack, or if the player can aim all around the screen. For now, simple left and right shooting is going to be the name of the game…
I have been spending the last week (on and off, as I had to make a drive over to Corvallis for the MECOP Fall Event), trying to integrate Tiled and TiledLib with my project. I learned a lot about the fantastic functionality of Tiled and how to actually go about using the program, which of course is going to become one of my main development environments when I need to start creating content for Ne+ (and really, I’d want to use Tiled for any 2D game moving forward), but I got hung up pretty badly once I started trying to load a map with XNA’s Content Pipeline and the TiledLib extension. I was getting an error about indexing past the end of an array in TiledLib’s map loading functions, so immediately I wondered what the deal was as I had tried out the demo and it worked perfectly.
So, I started taking a closer look at the demo – I was truly doing the absolute bare minimum in my project – declaring a map variable and then attempting to load the map file that I added to the content project, fully aware that the file was referencing a tile PNG with my one tile in it, but TiledLib was supposed to handle loading that for me. Eventually I just replaced the demo’s map with mine and saw my map load no problem in that project, but not in my own.
I debugged for a while, and saw that indeed, my project was not loading the PNG referenced in the map correctly. I pulled out garbage values where it was supposed to read the filename. Then I thought that maybe the file was getting processed incorrectly in my project, and then I remembered that there are settings for the importer and processor for every content item in your content project.
Sure enough, the importer and processor were blank. I set them to the TMX (map file extension) importer and processor, and bam, immediately the map appeared in the scene I’ve been testing. I still need to make my engine load up physics for the maps I load, and I think that with Tiled’s awesome ability to attach “properties” to tiles I’ll be able to decide whether or not the tiles are just for show, or should be “Collideable,” or anything else I can think of. I can also use Tiled to define player spawn points that don’t actually display on the screen, and other areas of interest. It’s a really cool program that provides nothing more than exactly what I’d want from it, and I can’t wait to start utilizing it more heavily.