https://github.com/csb6/squad-tactical-game
An XCOM-like, turn-based tactical game made in Ruby/Tk from a 2D, top-down perspective
https://github.com/csb6/squad-tactical-game
2d-game a-star-algorithm ruby
Last synced: about 1 year ago
JSON representation
An XCOM-like, turn-based tactical game made in Ruby/Tk from a 2D, top-down perspective
- Host: GitHub
- URL: https://github.com/csb6/squad-tactical-game
- Owner: csb6
- Created: 2018-12-23T23:30:59.000Z (over 7 years ago)
- Default Branch: ai
- Last Pushed: 2019-04-02T07:25:37.000Z (over 7 years ago)
- Last Synced: 2025-02-17T00:21:07.895Z (over 1 year ago)
- Topics: 2d-game, a-star-algorithm, ruby
- Language: Ruby
- Size: 209 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# squad-tactical-game
Demonstration Video:
[](http://youtu.be/vRx1T4qwkBg "Video Title")
An XCOM-like, turn-based tactical game made in Ruby/Tk from a 2D, top-down perspective.
The player controls a team of five blue soldiers, with the goal being to eliminate the enemy red soldiers by attacking them
several times.
While I did not complete the enemy AI code, I implemented the A* pathfinding algorithm, allowing players to
select a soldier, click on a destination and have a soldier find the shortest path there around obstacles. This was
fascinating to learn about and I hope to make use of it in further projects.
To play, make sure that you have recent versions of Ruby and Tk installed, navigate to the squad-tactical-game folder,
and run `ruby project-1.rb`
## Controls
**Left-click on a blue soldier** - Selects that soldier, displaying his stats in the right sidebar.
Remains selected until you press the deselect soldier button or you perform an action (ex: attacking someone)
**Right-click on the currently-selected soldier** - Shows contextual menu with some actions that soldier can take.
Info shows a window with a short description of the soldier, Overwatch allows the soldier to shoot any enemy that moves
within a few squares during the opponent's turn, Take Cover makes the selected soldier harder to hit.
**Right-click on a soldier who isn't the selected soldier** - Shows contextual menu showing chance to hit (HC) as a percentage
that decreases as distance increases. Click the Attack button in this menu to attempt to attack that soldier.
**End turn button in right side-menu** - When you're done with all of your moves, press this button to let the Red Team move.
One Red Soldier should move 5 squares to the right of the right-most blue soldier at the end of the prior turn.