Game
(Open Source Project) Planet Miner
10 years ago

Classes Details


All the classes are detailed here:

GameController.cs

GameController.cs is the class that controls the whole game.
Methods:
-Awake: makes it a singleton. Only one instance of it running in the game.
-ShowMenu/HideMenu: sets a menu active or !active (show and hide)
-Start:
-Sets the player (not gonna work at first)
-Sets the prices for resources
-Finds the menus’ panel objects and texts to edit in runtime.
-Set Price: sets the prices of resources
-Upgrade: used to call the Player upgrade method in buttons.
-SellInventory: used to call Player sell method in buttons
-Buy Fuel: used to call Player buy fuel method in buttons.
-Load Scene: used to call LoadLevel in buttons

======================================
CameraMove.cs

This class is used to make the camera follow the player smoothly.

======================================
Splash.cs

Controls the splash screen.

======================================
Player.cs

Controlls the player.
Methods:
-Start:
-sets the GameController.player,
-invokes ConsumeFuel every fuelConsTime (BUG DETECTED: The Fuel Tank upgrades wont work!)
-sets the texts to be edited at runtime
-sets the upgrade tiers to lvl 0
-Allow Movement: sets if the player is allowed to movement or not.
-ResetInventory: Resets the inventory to 0
-Movement: controlls the movement inputs
-AddMineral: adds a given mineral to the inventory.
-Correct Rotation: makes the player ship maintain a steady rotation.
-ShootRaycast: shoots a raycast in the given direction
-UpdateTexts: Updates all texts (GUI)
-BuyFuel: buys fuel
-Upgrade: Does the upgrades given
-UpdateAltitude: Updates the ship altitude
-ConsumeFuel: consumes fuel
-Update: checks if player is not dead, if not dead it updates the player.
-ShowScore: Called once the score is added to the leaderboards.
-Die: Makes the player die, sends the score to the leaderboards and present the game over menu.
-Reload: Play Again button.
-OnTriggerEnter2D: Detects if we are near a Gas station, Shop or Mechanic.
-Sell: Sells the inventory.

========================================
Mineral.cs

Handles the resources behavior.
Methods:
-Drilled, drills the mineral a certain amount
-LateUpdate: checks if the mineral is full drilled to destroy.
-Die: destroys the mineral, adds to the player.

========================================
Menu.cs

Handles the main menu.

========================================
Matrix.cs

The Matrix is the class that generates a random map full of resources.

There are two methods that generate a map:
Method1 is the used and best method.

Method1:
-Call GenerateResources();

Method2:
-Call generateMap();

OnGUI is commented, because it was used for debugging.



0 comments

Loading...

Next up

Been working lately on lots of 'behind-the-scenes' boring stuff that no one really cares about, so here’s a guy playing the sax for some reason.

#screenshotsaturday

🍒Did you like the game? A demo is available for free on Steam.

✌️ Thanks for playing IndieGameiacs!

⚙️ Free Demo: http://bit.ly/UniDuni

📺 Full Video: https://youtu.be/5qEbVXg7GaQ

#steam #uniduni #clops #screenshotsaturday

Path of Kami: The Evolution of the Lore

One of the most critical update for Sunblaze demo. Now you are able to pet a cat! Finally!

Microsoft Windows XP Unprofessional (windows logo prototype)

Terraria

Shuiro Haname. #Commission

Commission for @ShuHaname

Levels' maps.

Cash Banooca

If you’ve played the Vault demo and enjoyed it, please consider ‘liking’ the game page here on Gamejolt and/or leave a comment!

Also please consider tossing Vault on your Wishlist, I really appreciate your support!

https://store.steampowered.com/app/1251800