Game
(Open Source Project) Planet Miner
9 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

"Thanks guys for endless hours of fun." 👍

(My first fan art. Read the article, please.)

#sonic #mario #photoshop

I have added rewards for quests so that villagers can give you something in return for your hard work helping them. 🥳

I want to know - what's your favourite quest reward?

Werehog transformation process. #sonicunleashed

The whole squad is here!

Interested? Follow me!

Demonstration of the spells and their effects :)!

Horror WIP A track that will be featured in a future horror game soundtrack! Stay tuned!

Likes appreciated ✌️

#gamedev #composer #horrorgame #indiegame #IndieGameDev #soundtrack

Terraria

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?

Super Sonic Pixel art.

Subscribe to technoblade