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

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…

Shoobies leave a sticky trail of mucus in their wake, which can impede movement for any creature that steps in it.

Another house i made long time ago.

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?

Heya! I wanted to show some gameplay progress i made so far. I hope you like it ^^

Just a Pico sprite

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)

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

Likes appreciated ✌️

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

Today I tackled drawing different variations of facial expressions for one of the main characters in Eden. What do you think of it? :) Eden: https://gamejolt.com/games/Eden/592698

Some Shadow boss fight gameplay 👾