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

🍒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

Another house i made long time ago.

Quantum precognition is one of the most powerful cards. End game cards & equipment. Demo/alpha build boss is no match for this deck.

"Our work is never over" they said.

Family band complete!

In the quest for accessibility, I'm adding Resurrection Shrines for players on the 'novice' end of the platforming spectrum.

In order to unlock the power of a Shrine, you must collect 3 'Souls' from your dead corpses! (the floating blue orbs)

Update 2.627

New challenges & new effects!

Spaaaace~

These are background sprites I've created for a game I'm working on at school ^w^ Click on the post to see how the sprites connect. You won't regret it! (personally, I think it's pretty heheh)

Drawn in Piskel using my mouse. Whaddya think?

If you have more of an acquired taste, the restaurants in Niravasi have you covered! Maybe skip the salad bar, though.