Here are the things I’ve just done…
- Added a new light, the velocity light, which either increases or decreases the velocity of anything under it
- Added bullet animations and artwork and a flash animation for when they hit things
- Added a flashing light to the enemy that flashes and rolls at you
- Added an explosion animation for enemies when they get shot
- Added working 3D sound to enemy sound effects
It’s funny because none of these things were particularly challenging or time consuming, but the game seems way different now that it looks like something. Up until this point, I was playing the game with the debug view from the Farseer Physics Engine on, but now it can function as a visual element without physics debugging to show what’s happening in the physics world.
I am going to start expanding the level I have, adding some actual platforming, and I have been asked by classmates multiple times about adding a light that the player can control, so that seems like an obvious step to take. Moving platforms are something I’d like to have as well. It still isn’t that pretty, but I guess I need to get a video up of what it looks like. I know there are some friends that would love to play whatever I’ve got too, and I’ll make that happen this Thursday to get some advice on where I should go next, and of course to just get some end-user opinion.
I have some news about other projects that I’ll be posting about soon.
I just finished using XACT to create an RPC curve that is used with a distance variable to provide “3D” sound as an enemy approaches the player. Of course the game is 2D, and all I’m really doing is tweaking volume based on distance, but it’s a nice effect and very easy to do once you understand how to use XACT. I also added a shooting sound effect, and next on the list is to add animations for enemies being destroyed and bullets hitting things. I also want to integrate a couple of cool sprite sheets I found into the current test level to see how they look, and hopefully have a more visually appealing demo. Last time I played with creating level artwork I had a terrible visual issue in which tiles had line artifacts in-between each other; I might run into that again, and will have to spend some time figuring it out if that’s the case. I know it has to do with how scaling affects the sprite drawing, but I’m not yet sure what the remedy is.
So my work with Processing turned out to be immediately helpful in my XNA work; one of the things I did with Processing was create a sort of player that had a few different states with corresponding animations, so I basically ported that idea over to my Ne+ player. Now I have walking under its corresponding animation, and sprites for standing, jumping, falling, and crouching. I think that crouching is turning out to be pointless right now, although only because I’m not moving the physics object in such a way that it would dodge anything. I’m not going to worry about it at the moment, it can be a purely visual thing for now. The next thing I did was create a simple sprite for bullets, and start attaching lights to them as well. I hit a snag that I thought might be a Krypton issue for just a moment, but really what the problem is is that I am currently letting the player hold fire and shooting a bunch of bullets; the lights overlapping made them look like big red circles rather than a lit area, and I spent a couple moments tweaking Krypton values before realizing I just needed to add some limitation to the firing.
Rather big progress today, actually. I created another enemy that rolls at you, and I also created a bullet class and physics component, and added collision category support so that everything which collides with other things has well-defined properties. I also added “crouching” to the player, so that you can fire at two different heights. The bullets work flawlessly with the gravity light, which makes them angle upwards. This could be used to shoot the enemy that flies above you. I want to add artwork to the rolling enemy so that I can call it done, and I need to add the concept of health to the player. The enemies have health, but the player isn’t affected by them yet. Next steps are to limit the amount of bullets and make each key press fire only one bullet, and also to add artwork to the bullets and perhaps a little explosion animation when the bullet is destroyed. And then I want to create more lights, finally, now that everything is working pretty well. I will make a firm decision on which lights to move forward with shortly.
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’m currently working on creating the first enemy for Ne+, and with it I will be bringing my first actual animation into the project. I am creating the sprite sheet, and then will proceed to play the animation in XNA and then create an EnemyComponent which will try and attack the player. This means I will also need to have the player fire projectiles or something similar to fight enemies, and I hope to have both of these things done by Tuesday for my sprint presentation. I have a good idea of how it’s all going to work; I’ll have a collision category in Farseer that represents bullets, and then if the player bullets hit enemies the enemies will implement some action or death animation. I have a good idea of a death animation to use for my first enemy as well; Paint.NET has a bunch of cool effects that have values to manipulate, and often manipulating them in sequence offers some string of images that look like good animations to me, especially for projects on time constraints. I also have particle effects to play with, which I might use for when bullets hit platforms or something. The bullets could also emit a particle effect en route; I’m still thinking about it, however, all of this is polish-type stuff as opposed to actual new features like the basic things I want done by Tuesday.
One of my goals this week was to get parallax scrolling working, by importing TiledLib’s draw code into my Level class and adding some features. Now, any layer that I mark as a parallax layer can have a value assigned (right now 0.5 and 1.5 are the values I’m working with, and they just represent scroll speed as compared to the main level layer that the player traverses), and then the draw code will take care of the rest. Really easy stuff, actually, but it did take me a while to see exactly how I was going to add it. I exposed player position in the engine so that the level could draw itself accordingly… it’s definitely not the most elegant solution, but it got the job done for now and I’d like to keep pushing forward.
Currently, I’m in the middle of working on the player class. It just got a lot more complex without much extra code, because now I am actually using the wheel that I had my player’s main box sitting on. Up to this point, I was using it simply to smooth traversal over platforms that were directly next to each other, because jerky movement occurred when something like a square with harsh vertices hit the seams. But now, the movement is defined by rotating that circle, rather than simply applying a force pointing left or right, so I instantly get a couple of neat effects – first, if the player jumps, it isn’t possible to move in the air, because all that will be happening is the wheel rotating in the air. I do want the player to be able to move a bit in the air so I’ll define some special cases for that, but the feel of the movement seems a lot better to me now.
For now, I am going to define a standard jump height and then not let the player jump again until back on the ground, because right now it’s just possible to float forever. I might keep that in as a debug option for myself, because it’s nice to be able to go anywhere, but I’d like to be pretty much done with the player class for now, so after I get the air movement and jumping taken care of I’ll move on to some more new light classes, and parallax scrolling with some background and foreground art to spice up how things currently look.
Today I’ve been focusing on creating the tileset that Ne+ will use for its artwork. I am running into little walls here and there while learning exactly how to create reusable tiles that will enable me to build my level, even with something as simple as glowing platforms, but nothing too time consuming, and I’m also learning Paint.NET as I go. It seems to be working really well so far, and I think that, while the stuff I’m creating right now is pretty simple, it’s going to look okay for what it’s supposed to be. I’m not really looking forward to creating the artwork for the player, but I have been generating some ideas on alternatives for the player object, and having it be almost fully represented as a physics object so that there is less animation and more sprites whose positions are simply determined by Farseer; this would cut down on complexity, and also force me to create a more original main character. I have some ideas floating around, but we’ll see what I decide on after playing with them.