{"id":23431968,"url":"https://github.com/keremtan/wellshellgame","last_synced_at":"2026-03-06T10:04:28.128Z","repository":{"id":40826029,"uuid":"395130066","full_name":"KeremTAN/WellsHellGame","owner":"KeremTAN","description":"This is a demo game running on console. This game is designed to understand the uses of Strategy and Simple Factory Design Patterns.","archived":false,"fork":false,"pushed_at":"2023-01-22T12:52:02.000Z","size":85,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-27T13:45:59.977Z","etag":null,"topics":["design-patterns","designpatterns","factory-design-pattern","factory-pattern","java","patterns","simple-factory","simple-factory-design-pattern","simple-factory-pattern","strategy","strategy-design-pattern","strategy-pattern"],"latest_commit_sha":null,"homepage":"","language":"Java","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/KeremTAN.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}},"created_at":"2021-08-11T22:23:44.000Z","updated_at":"2024-12-07T15:30:55.000Z","dependencies_parsed_at":"2023-02-12T16:01:11.475Z","dependency_job_id":null,"html_url":"https://github.com/KeremTAN/WellsHellGame","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/KeremTAN/WellsHellGame","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KeremTAN%2FWellsHellGame","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KeremTAN%2FWellsHellGame/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KeremTAN%2FWellsHellGame/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KeremTAN%2FWellsHellGame/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KeremTAN","download_url":"https://codeload.github.com/KeremTAN/WellsHellGame/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KeremTAN%2FWellsHellGame/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30171656,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T07:56:45.623Z","status":"ssl_error","status_checked_at":"2026-03-06T07:55:55.621Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["design-patterns","designpatterns","factory-design-pattern","factory-pattern","java","patterns","simple-factory","simple-factory-design-pattern","simple-factory-pattern","strategy","strategy-design-pattern","strategy-pattern"],"created_at":"2024-12-23T10:51:51.419Z","updated_at":"2026-03-06T10:04:23.110Z","avatar_url":"https://github.com/KeremTAN.png","language":"Java","readme":"# Wells Hell Game\n## Strategy and Simple Factory Design Patterns\nRandom values are assigned to the places where data must be entered in the control class.\nIn this way, you can run and observe the game directly, or you can play the game on the console by changing the necessary places in the control class. \u003cbr/\u003e\n### Statement of Work:\nOur project is to design a 2 player fighting game. The logic of our game is \nquite simple. Although our game looks like a fighting game, it is actually a strategy game. Our \nplayers have to choose the most effective attack for them by trying to predict their opponent's \nmoves correctly to win the game. The game will be played on the console. When our game \nstarts, the players will first choose their characters. Players should only be able to create \ncharacters determined by us. The main characteristics of our characters are their attack power \nand self-defense coefficient. Characters can harm their opponents with their attack power and \nprotect themselves with their self-defense coefficient. After our players have selected their \ncharacters, the game will continue until 1 of 2 players has 0 health. During the game, our \nplayers will be asked to choose an attack to attack their opponent every time it comes to their \nturn, and according to this selected attack, our player will hit his opponent. In each attack \nselection, the hitting property of the player's fighter character must be changed instantly and \nthe hitting process must take place. \u003cbr/\u003e\n### Design Patterns:\nStrategy pattern and simple factory pattern were used in our project. The \nreason for this is as it will be remembered, our players were hitting each other in turn. In the \ngame, the same hitting can be done in different ways. A different percentage of the user's \nattack power is used according to each strike action. For the hitting process, the attack process \nthat the user wants to do is selected first. The choice made by our player is sent as a parameter \nto the createAttack method of an object of our FactoryAttack class. When the Attacks object \ncreated according to the sent value is sent back to us, we send the returned Attacks object as a \nparameter to the setAttacks method of our player's fight object. \u003cbr/\u003e\n\n```java\npublic int chooseAttack(Fighters attackPlayer) { \n  …\n  attackPlayer.setAttack(new FactoryAttack().createAttack(chosenAttack)); \n  … \n}\n```\n\nThanks to the FactoryAttacks object, although we do not see the background, the createAttack \nmethod produces the Attacks object we want. So we're using the simple factory pattern here.\nWith the value sent, we reset the Attacks area of our player's Fighters object. In this way, while \nour user only hits his opponent through the fight method, the hit method of the Attacks object \nin the fight method applies an attack strategy as desired by our player. So here we are using \nthe strategy pattern. The FactoryFighters class works the same as the FactoryAttack class. The \nonly difference is that instead of producing different objects for us, our Fighter object is \nproduced according to the rules we have determined.\n### UML:\n![UML](https://github.com/KeremTAN/WellsHellGame/blob/master/images/Uml.png)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeremtan%2Fwellshellgame","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkeremtan%2Fwellshellgame","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeremtan%2Fwellshellgame/lists"}