Part One - It begins
Part Two - Technical Foundation
Part Three - Game Design
Part Four - Input and Physics
Part Five - More Physics Things
Part Six - Even More Physics
Part Seven - User Interface
Part Eight - UI and the Editor
Part Nine - Editor Progress
Part Ten - Progress, and videos
Part Eleven - Fixing the Physics
Part Twelve - Unproductive
Part Thirteen - Context menu + enemies
Part Fourteen - Enemies and Problems
Part Two - Technical Foundation
Part Three - Game Design
Part Four - Input and Physics
Part Five - More Physics Things
Part Six - Even More Physics
Part Seven - User Interface
Part Eight - UI and the Editor
Part Nine - Editor Progress
Part Ten - Progress, and videos
Part Eleven - Fixing the Physics
Part Twelve - Unproductive
Part Thirteen - Context menu + enemies
Part Fourteen - Enemies and Problems
This Week
Hello again TeamLiquid! Welcome back to my blog about the development of The Adventures of Sam the Pirate, the 2D platformer I'm creating as the final game project for my Bachelor of Software Engineering degree. Last week I talked about implementing the first, most basic enemy and its interaction with the player. This week I'll be talking about continuing on with implementing the basic enemy, fixing the camera, multiple levels, and the first play testing session. I've also got some new concept art!
Basic Enemy
The basic zombie pirate is mostly done. I still need to have them turn around before falling off a platform, but otherwise they can kill the player, and the player can kill them. If both are attacking and have collided, then the zombie pirate gets priority and the player dies. If the player runs into the back of a zombie pirate without attacking, the zombie pirate turns around and kills the player.
It's pretty likely that they'll be the only enemy type present in this first version, as I don't think I'll have time to implement, and I'm not sure that my artists will have time to create the necessary animations. There's only 10 weeks left in my degree after all! (Which is actually kinda scary.)
Fixing the Camera
I fixed the camera and the scrolling this week as well. Previously, when I first set everything up, all the positions of the objects in the level, the player, tiles, etc, were initially done from screen co-ordinates, so if the resolution changed it would all display kind of weirdly. Not really sure why I did it that way in the first place, as it doesn't really work. When the camera was at (0,0), its top left corner was sitting at the top left corner of the screen, but not at the top left corner of the level, which is how I actually want it to work. So I adjusted the camera to take the screen resolution into account.
I then had to adjust the position of level objects, as the change to the camera had thrown everything off. Getting the vertical scrolling working was especially a bit tricky, as the camera is designed to follow the players position, I couldn't just take the players y position, or the difference between that and the point where vertical scrolling starts, as the cameras new y position. Again, I had to take into the level height relative to the screen height into account, so the new method of finding the correct y position for the camera looked something like this:
(level height - screen height) - (scroll up point - player y position)
Before hand, the cameras y position would have been at 0 when the player started moving up the screen, so I just took the difference between the scroll up point and the players y position (which was in screen co-ordinates!) to find the new y position.
Multiple Levels
I managed to implement multiple levels this week, no level selection screen just yet, but it's possible to play through more than one level and then return to the main menu. Right now it's really simple and you load into the next level immediately, but later on I'll need to display final score calculations before loading the next level. It works well enough as it is, however the first time I finished the first level and hit the second, I started running into invisible walls. Once I turned on my physics debugging so I could see bounding boxes, I discovered that all the physics actors from the previous level were still present! Once I fixed that by making sure a finished level was properly removed from everywhere it needed to be removed, so all the physics actors were destroyed, etc, everything worked nicely.
Play Testing
Had a little bit of external play testing today, which went ok. Some point during the week I seem to have created a few bugs, where occasionally the players position would not be reset correctly when they died, or enemies would appear inside platforms, or animations wouldn't play correctly, which was annoying, but that's programming for you I suppose. Add new features or modify/fix existing ones, break something else in the process. Otherwise testing went ok, got some good feedback on the movement and how the combat worked, including a couple things I hadn't thought of. I have been planning to change the size of the players bounding box when they attack, but it was suggested that I could just use a entirely separate one poking out in front of the player instead. Which might actually be easier to do instead.
New Art
This week I have a couple pieces of concept art showing off the basic zombie pirate.
What's next?
Next week I'll be attempting to fix some little bugs, adjust the movement, and possibly look at making the combat feel better. I'll also be looking to hopefully start work on the parallax effects. I'll probably do a new video some time next week as well.
Keep up to date!
Be sure to follow me on Twitter, and like the Facebook page to stay up to date on future content and blog posts when they happen. If you have any questions don't hesitate to ask, either through Twitter or Facebook! You can also check out the blog, previous posts, screenshots and videos over at my site.