{"id":13663883,"url":"https://github.com/ycarowr/SimpleTurnBasedGame","last_synced_at":"2025-04-25T18:31:31.454Z","repository":{"id":159107812,"uuid":"176101020","full_name":"ycarowr/SimpleTurnBasedGame","owner":"ycarowr","description":"A simple turn-based game exercise","archived":false,"fork":false,"pushed_at":"2019-10-13T11:19:52.000Z","size":3955,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-06T17:52:30.616Z","etag":null,"topics":["architecture","csharp","mvc","unity"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ycarowr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-17T12:55:23.000Z","updated_at":"2025-03-14T09:39:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"d09a62c3-9990-4e7c-9bd9-9dba37af1e75","html_url":"https://github.com/ycarowr/SimpleTurnBasedGame","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ycarowr%2FSimpleTurnBasedGame","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ycarowr%2FSimpleTurnBasedGame/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ycarowr%2FSimpleTurnBasedGame/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ycarowr%2FSimpleTurnBasedGame/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ycarowr","download_url":"https://codeload.github.com/ycarowr/SimpleTurnBasedGame/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250872074,"owners_count":21500761,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["architecture","csharp","mvc","unity"],"created_at":"2024-08-02T05:02:39.877Z","updated_at":"2025-04-25T18:31:31.443Z","avatar_url":"https://github.com/ycarowr.png","language":"C#","funding_links":[],"categories":["C\\#"],"sub_categories":[],"readme":"# Simple Turn-Based Game Core Mechanics\n\nThe repository contains the realization of the concepts described in this [repo](https://github.com/ycarowr/TurnBasedGameTemplate)\n\n## Description of the game:\n\nThe player who starts the match is decided randomly before the game starts, and the game play consists in a fight between two players who start the match with some health points. On each of the players turns, they have to choose one of the actions below:\n\n- give some damage to the opponent;\n- heal some damage itself;\n- a random option above with a bonus in the result;\n- wait the timeout and pass the turn doing nothing.\n\nThe loser is the player who reaches zero life points first.\n\n## Structures and funcionalities:\n- Two players, both sitting in the respective positions: Top and Bottom; (can be extended to more players)\n- Events such as Start and End match integrated with a simple UI;\n- Events like Player Started and Finished Turn also integrated with a simple UI;\n- Events that when players Heal and Deal damage;\n- Timeouts for players turns;\n- Restart point.\n\nI am not going to go further with details about the implementation because you can check the repo. But the idea is to have a MVC with a separation between logic and the data. The game logic driven by pure C# classes named [Processes](https://github.com/ycarowr/SimpleTurnBasedGame/blob/master/Assets/Scripts/SampleUsage/SimpleTurnBasedGame/Model/Game/Processes) which change the game data and dispatch events to the interested listeners. \n\nThe listeners are the [UI](https://github.com/ycarowr/SimpleTurnBasedGame/tree/master/Assets/Scripts/SampleUsage/SimpleTurnBasedGame/UI) components and the following [State Machine](https://github.com/ycarowr/SimpleTurnBasedGame/blob/master/Assets/Scripts/SampleUsage/SimpleTurnBasedGame/Controller/TurnBasedCs/TurnBasedFSM.cs) that has two purposes: to control the flow in the client side and hold the controllers (States) that provide access to the Processes mentioned earlier:\n\nAll the comunication among the Views and Controller is done using the [Singleton Pattern](https://github.com/ycarowr/SimpleTurnBasedGame/tree/master/Assets/Scripts/Patterns/Singleton) and the [Observer Pattern](https://github.com/ycarowr/SimpleTurnBasedGame/blob/master/Assets/Scripts/Patterns/Observer/Observer.cs).\n\n1. [Game Controller](https://github.com/ycarowr/SimpleTurnBasedGame/tree/master/Assets/Scripts/SampleUsage/SimpleTurnBasedGame/Controller) and [Turn-Based States](https://github.com/ycarowr/SimpleTurnBasedGame/tree/master/Assets/Scripts/SampleUsage/SimpleTurnBasedGame/Controller/TurnBasedCs/States)\n2. [Processes](https://github.com/ycarowr/SimpleTurnBasedGame/tree/master/Assets/Scripts/SampleUsage/SimpleTurnBasedGame/Model/Game/Processes)\n3. [Game Model](https://github.com/ycarowr/SimpleTurnBasedGame/tree/master/Assets/Scripts/SampleUsage/SimpleTurnBasedGame/Model/Game)\n4. [Game Events](https://github.com/ycarowr/SimpleTurnBasedGame/tree/master/Assets/Scripts/SampleUsage/SimpleTurnBasedGame/GameEvent)\n5. [Game Data](https://github.com/ycarowr/SimpleTurnBasedGame/tree/master/Assets/Scripts/SampleUsage/SimpleTurnBasedGame/GameData)\n6. [Game UI](https://github.com/ycarowr/SimpleTurnBasedGame/tree/master/Assets/Scripts/SampleUsage/SimpleTurnBasedGame/UI)\n7. [Game AI](https://github.com/ycarowr/SimpleTurnBasedGame/tree/master/Assets/Scripts/SampleUsage/SimpleTurnBasedGame/Model/Ai)\n8. [Some Patterns Used in the Implementation](https://github.com/ycarowr/SimpleTurnBasedGame/tree/master/Assets/Scripts/Patterns)\n9. [Configurations](https://github.com/ycarowr/SimpleTurnBasedGame/tree/master/Assets/Scripts/SampleUsage/SimpleTurnBasedGame/Configurations)\n\nGif for a better visualization of the Game Flow:\n\n![alt text](https://github.com/ycarowr/SimpleTurnBasedGame/blob/master/Assets/Textures/SimpleTurnBasedGame/gifs/Game%20Flow.gif)\n\nThe game is also a bit configurable, you can define:\n- Players Health;\n- Turn time out and time until start game;\n- Damage, Heal and Bonus for Random\n- AI Archetypes for both players;\n\n![Configurations](https://github.com/ycarowr/SimpleTurnBasedGame/blob/master/Assets/Scripts/SampleUsage/SimpleTurnBasedGame/Configurations/Editor/configs.JPG)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fycarowr%2FSimpleTurnBasedGame","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fycarowr%2FSimpleTurnBasedGame","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fycarowr%2FSimpleTurnBasedGame/lists"}