This is a one button game using processing 2. We use the processing core library for a small Java project. For more details about processing, please visit their website; https://processing.org/
This is actually a prototype for the class of User Interface Design in the winter semester of 2014/15 at the University of Salzburg. The challenge was to develop a game, that can be played by using just one button. Due to the fact, that processing offers this really handsome way to see, when you press the mouse, by just setting a boolean value to true, I am using this variable to do so.
The code seems to be weired and undhandy and you are probably thinking, their are better ways to do so. However, we tried to use the coding standard that is proposed by Jeff Bay, Object calisthenics. We were reading about this sheme in an article, and when we discussed it, we wanted to give it a shot. So do not blame us, for doing such big and uncomfortable looking like code, just be aware of these simple coding guide lines, that Jeff Bay recomends and that we are using currently (even if we are not able to catch up with all of these):
- One level of indentation per method
- Don’t use the ELSE keyword
- Wrap all primitives and Strings
- First class collections
- One dot per line except for this and me
- Don’t abbreviate
- Keep all entities small This means no class over 50 lines and no package over 10 files.
- No classes with more than two instance variables This will be hard
- No getters/setters/properties
However, when you look into out commit history, you will recognize, we did not used this coding style from the beginning of our project. So now (01/09/14) we are trying to do it this way.
Sources: Object Calisthenics by Jeff Bay at helsinki.fi
The One Button Game - Ninjas Journey is about a bean living in a can in you kitchen shelf. It is one of these mixed bean cans for ,29€ or something, that you bought ones for cooking a chilli or baked beans for a party at your house. So it is cheap food, and it remained their, because you forgot to use it, for this cheap chilli. However, the major point is, you forgot about it, and now it just lays in shelf - forgotten, getting older and older every day.
Did you ever asked yourself, what the beans are doing inside their? Are they just laying on each other, doing nothing all day? And what are this different kind of beans in this "mix"? So that is were I would like to start ...
A long, really long time ago, you and your siblings were living together in your bean bar, somewhere in middle or east Asia. You do not know exactly were you come from, because one day, a big someone came, and pulled you out of the bar. You where loosing your brothers and sisters in a dark, and big bowl. Their where other beans from all around the world, fearing, crying and loosing their minds. Suddenly, their was this whirl and you where pressed together with other beans inside another bowl and something. You where seeing sun light, it was a warm day, until the light was removed.
Forever ...
It was an catastrophe, their were a lot of different speaking beans with you inside this can or something. It is dark, everyone’s crying and all of a sudden, you meet one of your brothers, Brad "the roasted" Bean. He got that name basically due to the fact, that he loved to be at the end of the bar, where it gets a little bit hotter, and he actually liked that. So they called him, roasted.
However, after a while, everybody calms down and becomes smooth. So you where meeting Mexican beans, "Indian" beans and English beans. Some of them where peaceful and quite, others where rough and rude. So as it has to come, the great can war started. The Mexican beans where fighting together with the Indian beans against the English. After years (or at least, you think it were years) the war was over. A lot of beans died, like your brother. Due to a big fight, you were so angry that you have chosen to fight together with the Indian and Mexican beans against the English and your brother. Your brother was killed in the war, maybe during the battle for Beanington or Ingnatian. You are feeling guilty about what you have done, and are living at the floor of the can. You lost your only sibling, and are feeling so empty.
After some years have passed, you hear about a mysterious disease that is really contagious. You also heard rumors about your brother. He was running around in Beantown and biting people. You cannot believe what you have heard, he is alive? After all that years? So you are going on a journey to find your brother, but a lot of beans you meet have this mysterious illness. That beans that have not been infected yet, are calling it “The Mold” and are really scared about it. As a bean from the generic ninjata inclantata you have a lot of knowledge about the old ninja arts, and on the journey to find your brother, you have to use this skills. A bean on its journey, fighting against the mold zombie beans.
Have Fun