Writing Games with Processing: Setup and a Simple Player Character
We have an idea, now we need to write the game. Let’s use a screen size of 640 x 480: void setup() { size(640, 480); //VGA for those old enough to remember } The next item on the task list is to render...
View ArticleWriting Games with Processing: Enemies
The next element of our game are the crocodiles. Since we can have several of them, let’s use a class to collect all data necessary to draw them: class Enemy { color c; int x, y; String name;...
View ArticleWriting Games with Processing: Moving Around
The game would be pretty boring if Platty would just sit there, waiting to be eaten. The player needs to be able to move him around: void keyPressed() { if(key == CODED) { if(keyCode == UP) {...
View ArticleWriting Games with Processing: Hunting Platty
As it is, the game is pretty boring. The player has some control but no goal. Let’s add a routine which makes the enemies hunt the player. There are many complex algorithms for path finding but we aim...
View ArticleWriting Games with Processing: Eating Platty
If you try the code from the last session, you’ll notice that the crocodiles can reach Platty but the game doesn’t end. We’re missing collision detection. Following our KISS mantra, the collision...
View ArticleWriting Games with Processing: Winning
Now that the player can lose the game, he needs a way to win. One idea we had was that crocodiles are greedy: When they run into each other hunting Platty, they start to fight over the food. To achieve...
View ArticleWriting Games with Processing: Highscore!
What’s a game without a score? Boring! Luckily, adding scoring to our game is a piece of cake. We just count the number of moves that Platty survives. For this, we need another global variable: int...
View ArticleWriting Games with Processing: Cleaning Up
While the code for our game is simple enough, it’s starting to get messy. movePlayer() contains code to move the player, the enemies and the collision detection. Also, the game ends when you win. There...
View ArticleWriting Games with Processing: Intro Screen
Merry Christmas, everyone In the last post, we cleaned up the code. This makes it now very simple to add an intro to the game: class IntroState extends State { Player p; Enemy e; Step playerStep; Step...
View ArticleCameraSim: Ego Shooter With a Camera
To help people to learn how to make good photos (and what lighting, distance, focal length, aperture, ISO, etc. means), Jon Arnold created a game called “CameraSim” that looks a lot like an ego...
View Article