I’m currently working on a little game to keep my skills at a good level during my job / internship hunt. It’s nothing fancy, especially from the graphic point of view since I’m the one doing the sprites.
My initial idea was to make kind of a Ghouls and Ghosts. I plan to also add some rogue-like features but it is still to be determinated.
I try to work a fair amount of hours each weeks on this among the other activities that I do and it’s quite effective so far.
There is a thing to take in consideration while reading this page, I started writing on the project a little while after starting it so the first explanations in the beginning of the page will mostly be written, no screenshots. Also, the first three steps have been created simultaneously since they’re all prior to the date of creation of this page.
Step 1 : Starting the project
I started by making the main character's movements, having a good start on that would help me to go further next, and it worked well.
I also made my first animations :
Surely, they're not the best ones but at least they're mine ! If it goes to a bigger game maybe I'll update these and create better ones.The walking animation was a bit tricky but the fact that my character is fully white help me a lot since I don't have to deal with which arm goes where. I decided to analyse an animation I saw in a video a few days before (thanks TomSka) and recreate it as good as possible.
Making the character jump gave me a bit of a hard time because, suprisingly enough for someone who studied video game developping, I never made that before out of engines where it has already been done like Unity or Unreal Engine. If you look at my other projects, no one jumps because it has never been requested. I didn't want to just make the character position go up by increasing its Y location manually (which would have resulted in a triangular type of shape for the jump), so I chose to use a sinus since it has the right shape and is quite easy to use.
Beside some states transitions, the jump was the only real obstacle that stood before me regarding the movements.
Step 2 : Creating the weapon system
My first weapon is a dagger, I haven't figured out what makes it unique but since the character can kind of throw them all around nearly as often as he likes, I think it's gonna stay that way. It will be a rapid fire weapon with little damages, at least it's like that in my head for now.
Creating this weapon showed me a little problem, the throwing animation lasted too long, the weapon was thrown at the end of it and there was too much latency between the input and the action. I shortened the animation which is now maybe a little less visible but the overall gameplay is better.
I will certainly add more weapons later but I just wanted to make it work and do some other things before that.
Step 3 : The environment
Before choosing from hundred of designs for my sections, I created the first one just to try my idea.
I first created a text file with numbers in it :
0 being empty spots and 1, the ground.
Then, I created a class that reads that file and fills a sprite array where the ground tiles should be. The first section of my game was born ! I made a Level Manager containing three sections which were going to move one behind the other to create a scrolling, it worked pretty well and pretty quick, so I continued to my main idea and created another class named Pattern which contains an array of char filled with the zeros and ones and also the height of the first and the last tile for junction purposes (the next section can't be too high from the previous one or the character will not be able to continue).
I finally set in motion my idea : the Level Manager reads all the section files stored in a specific directory and creates the same number of pattern in a list. Sections are instanciated from the manager by selecting a random (and fitting in height) pattern from that list. At the beginning of the game, three sections are created and as the character walks new ones are added behind the previous ones.
Another big development part was to make the scenery move in function of the player's inputs, when to stop the character and when could it move freely, same went for the environment. I determined a zone were the character could move and beyond it, move the scenery.
The final step of the environment management was to step on the different tiles (the character was flying at the middle of the window untill then). I simply created a function that determines where the ground is under the character and if the latest is on, above or under that level. If the character is under ground level, it's raised, other wise no action is done.
Step 4 : Conclusion on the three previous steps and what's next
The character teleports itself when the tiles are not on the same level instead of falling a bit or jumping. This issue is the next thing I will work on I think and I'm even going to block the character when the next tile is higher so the player will have to make a jump.
Another simple thing to do is destroying the weapons that touches a tile when moving, I don't want daggers digging in the ground !
Of course, later will come enemies and a better handling of the pattern selection for the sections creation. Currently the pattern are not sorted in any way which means that they are all a potential selection even if they will never fit. I intend to maybe sort them by entry height to go faster and do fewer iterations and random calls. I also have to verify the first three section created as I can have junction issues on these.
I think that's all for now so I leave a video of the current version of the game right there .
Step 5 : Controller support and enemies
But let's talk about the new features of the project, I resolved many bugs like the teleportation of the character and improved a bit its jump for a better transition to the falling state. I managed the destruction of the weapons when touching an enemy or the scenery.
I sorted the patterns by height in an array of pattern lists like that :
There are 12 slots for each height and patterns will be added in each if their entry height is compatible with the index. For example in the 8th index, there will be patterns with an entry height of 7, 8 and 9. That way it isn't necessary to check if the randomly chosen pattern will fit the one before, this allow me to do fewer instructions each time I instanciate a new section, I juste have to do a random in the list for the layout.
Also in the topic of section creation, I resolved the little issue I had with the first three that could not fit sometimes.
Like I said at the beginning I added controller support to the game so the character can move with the left joystick or the Dpad and use the face buttons to jump and use weapons.
Big addition to the game, I created some enemies that are created with each new section, 3 at a time. For now, they stay put where they appear and wait to detect the player in their area then proceed to pursue the player without ever stopping. They can even jump and fall so they can continue their pursuit. The weapons can damage the enemies and kill them in which case they stand still. Enemies states transitions are possible thanks to a Finite-State Machine that we used in school on Warcreaft.
Among the next objectives :
Destroy the enemies when they die maybe after an animation (they are already destroyed if they're on a section that has passed the left border of the screen).
Making the ennemies attack and hurt the character.
Making the enemies walk when they do nothing would be nice so they don't stand still like billboards.
Like last time I leave a little progression video where we see the controller gameplay and the enemies.