Solitaire
A Solitaire clone made in Unity.
A majority of the game is based off of the "Let's Make Soltaire in Unity" series by Megalomobile. I then made a few adjustments based on what I know (and am still learning!) about OOP and Unity.
As for the card art, I chose a pixel art style because I was inspired by Inscryption at the time. This is the first time I've actually done this type of style as well.
Notes
Changes done compared to the original tutorial
-
Encapsulation: Several variables were set as
public
, which I've switched toprivate
as there was no need for the Unity Inspector to see certain variables. Public methods were added if those private variables needed to be retrieved.- For variables that I wanted to keep public to be shared between scripts but still did not want it to be shown in the Inspector, I added
{ get; private set; }
- For variables that I wanted to keep public to be shared between scripts but still did not want it to be shown in the Inspector, I added
-
Avoided
Update()
on all scripts except forPlayerInput.cs
. The game is interactive only through mouse clicks, so calling any other method throughUpdate()
was unnecessary. -
Utilized
Awake()
, where I instantiated the script's private variables and anyGetComponent
on theGameObject
they are attached to.- Anything that involved other scripts and/or GameObjects was done in
Start()
.
- Anything that involved other scripts and/or GameObjects was done in
Further Development
-
Allow player to choose between drawing one or three cards for the Talon pile.
-
Current implementation uses
Toggle
and is saved inPlayerPrefs
. Upon exiting the Options Menu, the game is restarted (scene is NOT reloaded) with the updated preference. -
Alternatively, ask option at the start of each new game. (May get tedious over time?)
-
-
Allow the player to build sequences with double-clicks and/or drag-and-drop.
-
Double-clicks: Will probably need to use the
EventSystem
. -
Drag-and-drop: Compare
Collider
on mouse up?
-
-
Track score, time, number of moves, etc.
License
All artwork / assets used in this project is licensed under the Creative Commons Attribution Share Alike 4.0 license.
The project's source code is licensed under the GNU General Public License.