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 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
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 more about the context menu, and talked a bit about enemy behaviours. This week I'll be talking about implementing the first, most basic enemy and its interaction with the player.
Basic Zombie Pirates
The basic zombie pirate is now mostly implemented. They're moving back and forth, although they don't yet detect the edge of a cliff and so just walk right off, which is not the intended behaviour. I will be working on this a bit over the weekend, so they turn around instead of walking off. They do turn around when they hit a wall though! As for their AI, I decided to keep things simple, and just have them attack on a timer. It's likely all other enemies will have similar behaviour. No death animations being triggered just yet, that is next on the to do list.
I would love to do more, such as having enemies chase the player for a peroid of time if the player enters their line of sight, but there isn't enough time left to implement this. It will definitely be something I look at redoing in the future, as it is very likely I'll be doing a lot of work after graduation on the game, improving under the hood performance, changing AI, maybe adding new features/enemies to levels.
New Problems
So this week I discovered a problem with the sprite creation/loading system I created near the beginning of the project. Whenever I wanted to create a new sprite, the sprite system compared the file path of the requested sprite sheet against what had already been loaded. If it had already been loaded, then that sprite object was simply returned, and no new sprite object was created. This sounds all fine and dandy, as I don't want to load the same sprite sheet into memory multiple times, however this sprite object contains, as well as the art, the positional and animation information. So when I created multiple enemies, while their positions were different (as this is set separately for each enemy), they were sharing animation information, and so displayed exactly the same. So for instance, I could have an enemy displaying the run left animation, but be moving right. Which is obviously silly!
In hindsight, it would have made far more sense to shift loading the sprite sheet texture into a separate texture loading system (which I don't currently have), rather than keeping it as part of the sprite object. I didn't think of this at the time though, and don't really have time to fix it at the moment. Another thing to add to the list of things I'm going to do after graduation.
What's next?
I'll be finishing up the player/enemy interaction, including making sure death animations are played when something dies. I'll also starting looking at implementing parallax scrolling, so the background is a bit more interesting than a static image. Having a play testing session on the Friday with all the tutors, so hopefully I'll actually have some proper art in the game by then.
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.