This week, I reviewed chapter 8 from Learning Java by Building Android Games 3rd Edition by John Horton. This chapter reviews some of the principles of object-oriented programming, including encapsulation, inheritance, and polymorphism. Interestingly, the principle of abstraction that was named alongside the previous three in the course syllabus is not reviewed in this chapter of the book. I chose to write about this resource because in the last Spring semester, I studied this book in order to create a functional mobile game in Android Studio for my final project in my Operating Systems course. I needed to apply my knowledge of arrays, for and while loops, and Java class design to complete this project. In addition, I needed to learn how to utilize the graphics libraries within Android Studio to visually represent the entities within the game and how they interacted with each other. While this book did help me tremendously in the later stages of the project, I wish I had found it earlier before I began coding. I had begun the project in BlueJ, and was coding a Java app meant to be run on a Windows or Mac system, not an Android mobile device as was the project specification. I completed a functioning version of the game with all the features I wanted to include that ran on my Windows PC, but I found it much more difficult than I anticipated to port the code I had written into Android Studio to produce a version of the game that would function on mobile devices. However, because I had applied the principles of encapsulation, inheritance, and polymorphism to my Java classes and functions, I was able to get the program to a partially functioning state on Android by the final due date. My first challenge in porting the project from PC to Android was addressing how to display the program on the device’s screen. Through this book, I found that constructing my Game class so it would extend Android’s Activity class would be the first step in displaying the desired output. I also applied the principle of inheritance to the Java classes I created to represent the in-game objects represented on screen. As many objects as I could manage inherited from a parent GameObject interface, which would be extended into more specific StaticGameObject and MovableGameObject subclasses, and then from those classes I extended them into specific types of objects like PlayerCharacter, Obstacle, and BonusItem. For my next software endeavor, I want to adhere to these principles more purposefully when coding, as I think that a lot of the challenges and headaches I experienced while creating this video game were self-inflicted.
If you want to try the game I made (I was so pressed for time by the end I never named it), here is a link to my Github repository. The project should be able to opened up and run from inside BlueJ or your Java IDE of choice.
Source: Learning Java by Building Android Games: Learn Java and Android from scratch by building five exciting games, 3rd Edition by John Horton
Hi! My name is Tempura, I’m a college student currently attending Worcester State, going for a Bachelor’s in Computer Science. My pronouns are He/She/They, I don’t really have a preference.
I’m huge into video games and anything that flexes my creative muscle, which is why I’m going into a focus of Software Design and Development for my Junior year. I’ll be taking CS 343 and 348 with Professor Wurst, and as a part of that course, I’ll be starting this blog!
I hope to utilize this blog throughout my career, but for now I’ll be using it to go over what I’ve been doing and learning in my courses!
I hope you enjoy taking this journey alongside me!
Welcome to Tech. Worth Talking About (TWTA), a blog discussing exciting and impactful tools and innovations in the technology world, as well as some ideas on how to implement them in real situations to solve problems. Stay tuned for these posts and more!
Welcome to my first blog post! My name is Andi Cuni and I am a senior completing my undergraduate CS degree. Starting my journey blogging with a background in computer science and software development, I am excited for this transition, and I plan to share everything that comes along my experiences to see if others relate as well!
Welcome to my first blog post! My name is Zack Tram and am a senior completing my undergraduate CS degree. In the upcoming weeks, I’ll be posting about topics relating to how software is managed, designed and constructed.
I look forward to completing my degree this year, and everything that comes with it!
My name is Namson Nguyen. I love baking, playing the piano/violin, and learning new languages and their respective cultures.
However, the purpose of this blog is not to talk about myself, but rather, as a Junior majoring in Computer Science, it is to discover more about the huge realm of technology, as well as to hone my self-researching skills — an essential tool in the professional world. Through the course of my college years, I hope to share with you my favorite reads and fun discoveries, summarizing what I’ve learned as well as my own personal thoughts (excluding those about pastries, français, and the fiddle of course!).
So I hope you’ll follow along with me on my journey as a student in this rapidly advancing technological world. There’s a lot to learn and a lot to see in the next few years and a whole lot more after that.