An extremely basic battle simulator I did for college. It's pretty terrible.
I had to make a game for college. In C++. I was originally gonna reuse my playerobject
project, but that was done in Python, and the requirements asked for C++ in particular, so I had to come up with something on my own.
Based off of my aforementioned project, but fundamentally different, this project was intended to be an RPG game. Since I really suck at C++, and considering the deadline, it's now Extremely Basic Battle Simulator, obviously ripping off inspired by the title of Landfall Games' Totally Accurate Battle Simulator.
Yeah, you heard me. This consists of one C++ program that works via command-line. It also uses cross-platform stuff, so you can compile and run it with basically anything that supports C++11.
Compiling is super easy.
On Linux and macOS, you should be able to run g++
from the command line.
On Windows, you should probably install MinGW. See here for a tutorial on using g++
.
If you just wanna run the code without the hassle of using the command line, you can use a website like cpp.sh and paste the source code in there.
If you can't even do that, you can run the code at repl.it.
Seriously? Too lazy to click a link? Alright, fine, I'll show you some output...
SpeedX243 challenges Enemy to a fight!
SpeedX243 attacks! Dealt 50 points of damage!
Enemy received 50 points of damage! Enemy now has 100 points of health!
Enemy attacks! Dealt 20 points of damage!
SpeedX243 received 20 points of damage! SpeedX243 now has 100 points of health!
SpeedX243 attacks! Dealt 50 points of damage!
Enemy received 50 points of damage! Enemy now has 50 points of health!
Enemy attacks! Dealt 20 points of damage!
SpeedX243 received 20 points of damage! SpeedX243 now has 80 points of health!
Enemy has been defeated! Victory!