The game that we are going to make is a simple 2D fighting game. You have a certain number of lives and the enemy has a certain number of lives and your goal is to avoid being hit by him or his stars while shooting him with your own stars until his lives deplete. Demo and download will be included with last part.
Tag Archives: Processingjs
We define all the methods that will run recursively and start defining them in the tutorial first part now its time to implement it in real, now the actual game part follows.
The next method is a bit lengthy and it involves all collision tests as well as some image visualizations. First, we loop for each star the player has launched and if any of the stars is behind the left edge of the screen, we remove it and continue with the next star. If it is not, we move it to the right, display it and check if it has hit the enemy. If it indeed hit the enemy – we reduce the enemy’s lives by 1 and empty all player stars.
We had a look at some of the basics of making a game using the Processing.js game library, so let’s kick it up a notch by just getting down and making our own Super Mario game. When we’re done with this part of the tutorial, we’ll have a game with koopa troopers, platforms that we can jump up through but not fall down through, a hole with terrible muncher plants, coins, including a mysterious dragon coin, a giant banzai bill bullet that comes out of nowhere, and even some advanced things like not actually putting enemies in the level from the start, but only just before you get to where they’re supposed to be.
And it’s going to be pretty sweet. Let’s get started!