Create a game whereby a ship at the bottom of the screen avoids falling torpedos. A scoring system is displaye in game and sound has been added for dramatic effect.
produced by: Robert Hillson
The Cruel Sea. The thinking behind this is purley reactive to the current plight we face during lock-down. The BBC’s choice of film streaming for the general public and some of those narratives within them all seem to favour a sentiment reminiscient of the Second World War. This particular film (The Cruel Sea. 1953. [Film] Charles Frend.) is indicative of others currently on stream, whose content attempts to portrayal community loyalty and a sense of togetherness for the greater good. As they are now, deciding on who dies, rationing and the plight of close quarters for each other etc, I felt the all encompassing idea from the BBC was integrate our way of thinking. The game I have was intended to reflect these ideas. As it is the game has only come so far in doing that. The the film itself depicts the mass killing of war survivors and also reflects state of rationing. My game is still in its embyonic stage. As it is there is only an object that avoids other objects, in the film depth charges are catapulted into the sea to, this would have been implemented but for time. The reasoning here is to recongize how a common community objective can easily influence our perspective on what is right and what is wrong.
To begin with I tried to insure that any code I wrote was pretty much based on psedocode and eventually turn into code. In retrospect I think this takes practice because there is a lot to be desired in writing down every single element of program. However I guess in a coporate environment this may be standard. I persisted with the idea of using psedocode and I think it paid off when the ideas became to complex to reason without actively running through them on paper. After starting to use Object Orientated Programming in a more confident way, I felt inclined to encapsulate every little chunk of code; however, I soon came to realize, that the actual requirements for, classes, objects and methods should drive this need and not for any other reason. Trying to understanding that idea had become a slow process and one that could have been avoided. I used the OSC add on for interaction between my phone (Huewai P20) an my laptop running Windows 7 (Dell Latitude E6230) . After lots of testing and recoding I can see now how easy it is to introduce new classes. This aon did not come with out issues and I was difficult to see any warnings about this but DHCP IP address on devices on my network went through a phases of changing a lot. It was fairly random.
I had created a timer with this game which drove the release of torpedos. The idea of a timer I would say is invaluable for tasks such as timing events! Finally I am happy that I was able to implement classes and objects in the code which allowed me to avoid duplication. The comments in my code were shortened in order to be more consice, I tried to get across the idea of the function rather than describe the syntax. Hopefully this woul have made the code a lot clearer. Finally I added a scoring system and sound. Both were fairly easy to manage. Again I felt once the engine was operational additions could be added quite easily. My method for this was to create many mini programs for testing. Once happy I would then intergrate in my code. I did this for both the string and sound classes.
The use of vectors to duplicate a class really added structure to the program. After I managed to get this part running, I started to think in terms of an engine behind the program and other elements were eventually added, this idea of an engine is perhaps a way I will approach my next assignment.
In essence I would write this game again. It is not without short falls. There are many problems with it. It doesn't have a sophisticated start or end. There are many elements in my orginal idea that obviously do not shine through. I am very happy about being able to confidently create a class and use in the code. That said the game itself lacks a lot. It works! But it needs a complete overhaul. I am particularly disappointed that I was unable to level up the excitement by increasing the speed of the torpedos based on time. A simple ofMap may have sufficed.
Now that I have the benefits of using OOP, I feel there are many instances in this work that could be reworked. In fact I woul imagine a completely different setup whereby I could introuce pointers. They are very much absent.
One of my original classes was designed to replicate an object (a torpedo). This worked well. But after realising I had issues accessing the object from an entirely different class I was set back by many days trying to unravel my desgin. My other class (driven by OSC), a ship, also worked well until I tried to get it to communciate with another clas, in the end I simplified this problem by using limited classes.
After using a vector to replicate my torpedo class, and accessing the attributes and behaviours from a main program I really felt this was the tipping point. Even looking at code now seems so much easier and less daunting.
The Nature of Code: Simulating Natural Systems with Processing 1st Edition by Daniel Shiffman
Chapter 9. The Evolution of Code.
Learning Processing: A Beginner's Guide to Programming Images, Animation, and Interaction (Morgan Kaufmann Series in Computer Graphics) 1st Edition by Daniel Shiffman
Chapter 10. Algorithms Pages (165 – 189)
https://forum.openframeworks.cc/t/circle-to-circle-collisions-and-physics/2004/10 (Theo May ’09)
https://forum.openframeworks.cc/t/moving-a-rectangle-and-changing-direction/31178/2 (Dorald Nov ’18)
https://www.youtube.com/watch?v=okpIBrT7A70&list=PL4neAtv21WOmrV8z9rSzL20QpdLU1zJLr&index=17 (Lewis Lepton online openframeworks series of tutorials).