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

Short intro of us 💕✌️

We're an eletro duo based in Seoul 🇰🇷 Heavily influenced by the 90s.

Our new album #Xennials is all about the nostalgia of that era 💽 CD listenin 📟 beeper beepin 💾 floppy disks floppin days 😎

Stream now! 🎧

https://open.spotify.com/album/3YwWhnHWVy5cA8XOpbaGRA?si=8E9awqU…

art comission.

"Thanks guys for endless hours of fun." 👍

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

#sonic #mario #photoshop

Runestones: from concept to in-game model🗿

The whole squad is here!

Interested? Follow me!

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?

Cash Banooca

Animation test. Not an actaul conclusion to who wins sonic vs Mario. Just a test animation combo.

Magic staffs created especially for each sign

#moba #zodiac #magic #staff #signs #gamedev #3Dart