Descriptions for VB Files Resources - JMcQueen1000/Battleships GitHub Wiki

Source Code Descriptions

  • Direction.vb: Enumeration of orientation of ship (Left/Right).

  • ISeaGrid.vb: Defines the Read Only interface of Grid and allows player to see opponents grid and what and what hasn't been attacked

  • Player.vb: Checks to see if the ships have all been destroyed/deployed, Sets grid from self and enemy, Sets ship names, records number of shots made by player, Sets players Score, Returns players attack has hit or miss, Allows for random posistions of ships,

  • ResultOfAttack.vb: Enumeration of players attack.

  • SeaGrid.vb: Gets Sea Grid's Width and height, deployment status of ships, ship name, allows players to move, add and remove ships, Hit functions and tracking of which tiles have been hit/missed

  • SeaGridAdapter.vb: allows for the change in a sea grid view. Whenever a ship is presented it changes the view into a sea tile instead of a ship tile.

  • Ship.vb: contains all the information about itself. This includes its name, size, number of hits taken and its location. It is able to add or remove ship tiles on the SeaGrid, and tell if it is deployed or destroyed.

  • ShipName.vb: is an enumeration of all ship names including sizes from 0-5

  • Tile.vb: contains information on itself. This includes if it is a sea tile, ship tile or if it has been shot. It also knows where it is on the grid, and can tell the grid what tile it is.

  • TileView.vb: is an enumeration of all types of tiles including sea tile, miss tile, ship tile, and hit tile.

  • DeploymentController.vb: Controls the players and what they do when the ships are being setup, this includes when choosing ships and where they are placed on the board, selecting ships. Deploying ships and changing the direction of the ships that are to be added.

  • DiscoveryController.vb: Controls the battle portion of the battleship game. When the user clicks the mouse that location will be attacked. This file also does all of the drawing in the attack portion.

  • EndingGameController.vb: Controls the game at the end of the game, includes drawing the end game screen and shows who won and who lost.

  • GameController.vb: GameController is correctly named as it controls the game, these includes managing user input and displaying the current frame of the game. Gets the player and AI to attack and checks the result of the attack, if that action results in a end game it switches to previous file.

  • GameLogic.vb: Open new window and loads in resources. Has the main game loop and frees all the resources once game has ended and closes all audio at end of the game.

  • AIPlayer.vb: Controls the basic AI commands that the 'player 2' CPU has control over. This file is the parent class of the other AI classes. The other AI classes change the difficulty of the CPU, so they add extra commands where necessary to amp the difficulty up. AIPlayer.vb has basic commands like choosing a tile to attack, knowing the previous tile they attacked, and knowing if they previously hit a battleship, among others. This class is also a proxy for the 'easy' AI.

  • AIOption.vb: A simple file which only holds an enumeration for the difficulty options. The options are easy, medium, and hard.

  • AIMedium.vb: This class inherits from AIPlayer.vb, and is used by the CPU if the medium difficulty is chosen. This class allows the AI to attempt to destroy a whole ship once they have hit a ship, instead of randomly choosing a location to attack next.

  • AIHard.vb: This class inherits from the AIPlayer class, and is used by the CPU if the hard difficulty option is selected. This class allows the AI to know the direction of a ship when two spots on a ship have been hit, allowing the CPU to easily determine the rest of the target locations. If a ship has been destroyed, and there is still a gap between hits, the AI will know that another ship has been located, and attempt to destroy that one in a similar fashion to the first. This class determines the behaviour for the most difficult of the AI options.

  • AttackResult.vb: This class returns the result of an attack; either 'hit' or 'miss.' This class can also determine if a ship is destroyed, and thus will return a text string stating "[ship] has been destroyed."

  • BattleShipsGame.vb: This class controls a large amount of functions, and is responsible for the correct flow of the game. The class will make sure there are two players, and will make sure all the ships are placed before a game can properly start. This class allows players to shoot, and also is responsible for switching the turns between players, to simulate how the game operates in real life. This class allows the players to see the enemy player's sea grid, so they can keep track of where they have aimed, and all the hits and misses. Finally, this class can check if ships have been destroyed, and will exit the game when all of one player's ships have been destroyed.

  • UtilityFunctions.vb: this resource file is utilized to interact with the mouse, it can determine if the mouse is over a specific area of the rectangular game interface. it is also used to draw or create the initial game interface and other changes in the game as players continue to play it. It can create and remove animations according to the outcome of the players inputs and by detecting the functions of the mouse.

  • MenuController.vb: this is the file that controls the menus of the game including the game menu and the settings, firstly it creates the structure of the menu with the text that is needed to describe the graphical interface. It handles the input that is provided by the user while interacting with menu including the settings as well this is done my monitoring and interfering with the mouse and the mouse buttons activity which will trigger and various functions to interact with the buttons using swingame.

  • HighScoreController.vb: as the name suggests this file is used to deal with the scores and high scores of the player and it is also being saved in an external file a string value and an integer value is used to display the player name and the score of the player together this file also allows the scores to be compared between players using an if else function to demonstrate which score is higher. this is used to process the scores in the external file and to get an output of the highest score from all the values entered thus giving the highest score and the corresponding string value that is the name of the player together with the integer value.

  • GameState.vb: this file is used to call or run other files that are useful to the game to present the current state of the game which can be varied from viewing the menu to ending the game.

  • GameResources.vb: this file is used to call all the resource files that are related to the game such as image files and sound effects that create the game and the gameplay for the player

List of Other Resources

Animations

  • splash.txt: contains the splash and explosion animation for the game.
  • startup.txt: plays the SwinGame animation at the startup of the game.

Bundles

  • FileDialog.txt: contains bitmaps, images, fonts, and sounds for file dialog throughout the game.
  • splash.txt: This loads all of the resourced used by the splash screen

Fonts

  • The following fonts are used throughout the game -arial.ttf -cour.ttf -ffaccess.ttf -maven_pro_regular.ttf

Images

-The following images are used throughout the game to display the game to the player. -deploy.jpg

-deploy_button_hl.png

-deploy_dir_button_horiz.png

-deploy_dir_button_vert.png

-deploy_play_button.png

-deploy_randomize_button.png

-discover.jpg

-explosion.png

-fdFile.png

-fdFolder.png

-FileDialog_Active.png

-FileDialog_Background.png

-FileDialog_Inactive.png

-FileDialog_Scroll.png

-FileDialog_ScrollSmall.png

-loader_empty.png

-loader_full.png

-.main_page.jpg

-ship_deploy_horiz_1.png

-ship_deploy_horiz_2.png

-ship_deploy_horiz_3.png

-ship_deploy_horiz_4.png

-ship_deploy_horiz_5.png

-ship_deploy_vert_1.png

-ship_deploy_vert_2.png

-ship_deploy_vert_3.png

-ship_deploy_vert_4.png

-ship_deploy_vert_5.png

-splash.png

-SplashBack.png

-Swinburne.jpg

-SwinGameAni.jpg

-SwinGameAni.png

Panels

-FileDialog.txt: Loads bitmaps for the panels in the game.

Sounds

-The following is a list of sounds found in the game -error.wav

-hit.wav

-horrordrone.mp3

-lose.wav

-sink.wav

-SwinGameStart.ogg

-SwinGameStart.wav

-watershot.wav

-winner.wav

Miscellaneous Files

-highscores.txt: Text file that keep track of highscores. -SwinGame.ico: The SwinGame icon file.