I have made the Bubble Shooter game as my third game. It uses a client-server architecture and is a single player game. I will give instructions on how to run the program and in the following sections explain certain parts of the game.
There are two ways to run my Space Invaders game with scripting enabled:
-
JAR:
- Find the JAR file for this project in
[root_dir]\out\artifacts\bubble_shooter_jar\bubble-shooter.jar
. - Open a command line and type
java -jar bubble-shooter.jar s
(for server). - For running clients, open other command lines, type and execute
java -jar bubble-shooter.jar c
ONCE. This game is implemented using a client-server architecture but is a single-player game. So there can be only one client. Running more clients may have undefined results. - Remember that you need the run the server first and then the client, otherwise this might throw some exception. This should be normal, as for most multiplayer games, the headless server generally is always running.
- Also currently, the client searches for a running server in
localhost
, so running the server and client in different computers will not work. If you still want to run it in different computers, follow my second way of running the program and before building it, openConstants.java
and assign the server's IP to theSERVER_ADDRESS
String variable.
- Find the JAR file for this project in
-
IntelliJ:
- Install IntelliJ Community Edition.
- Import and build my project.
- There should be two run configurations - one for the server and one for the client. Run the "Server" first and then the "Client". The shortcut for running programs in IntelliJ is
Alt + Shift + F10
. - If you don't find the run configurations, make two yourself. For the sever, give a command line argument of
s
and for the client, give a command line argument ofc
(without the quotes).
The controls are displayed on screen, but still I will give a description of the same here:
- Move the mouse to control the turret direction.
- Press
SPACE
to shoot bubbles.
This follows the classic game rules. I will list them and any variations here:
- There are 9 rows of bubbles initially.
- Additional rows get added from the bubbles that you shoot.
- The bubbles keep coming down at a constant pace.
- There are three colors of bubbles: red, green and blue.
- The objective is to shoot and match all bubbles before it reaches the red line.
- If the player loses, the game restarts with a new set of bubbles.
- Three bubbles to be fired are shown beside the player controller turret.
- A score is maintained which is based on the number of bubbles you match.
- Two bubbles of the same color are matched. The matching is done with neighbors on the left, right and two on the top.
- The game is continuous, i.e. if you die, then it restarts and you keep building your score.
The server here creates the bubble map and sends it over to the client, i.e. it establishes the environment. From there on, the client handles the player movements and killing of enemies.
Scripting is enabled in my game and the script file lies in the same directory as my previous assignment section. This is the same as the last game's script. In the script file I can change the color of my player to something else. I expose the player object to the script and then I call the changeColor
method in that to change the color.
This is exactly the same as my second game report and I have made no extra changes to my engine between my second and third game. So, I will just give the new set of difference images below.
Here is a report for the src
folder comparison.
Full reports are available in the reports
directory. The reports were taken using a trial version of Araxis Merge.
All in all, it was very interesting to use my game engine and make another new game. Like before, it was a very smooth process.
I have uploaded a screencast to YouTube so that it's easier for you to check what I've done. I play the game one time and when the bubbles reach the bottom, you can see that the game restarts with the death count increased by one. I also show the use of scripts in the end.
https://www.youtube.com/watch?v=o7P0cNh5ofI&feature=youtu.be