Hi,
I’m making a game with a friend, inspired by an old game called Colobot.
In our game, you will have 2 teams, each with 10 tanks.
These tanks can drive, turn, aim, shoot and scan for targets, but do nothing on their own, nor do they react to input.
The goal in the game is to write a (very) basic script in a .txt file, which could look something like this:
--
scan
ifFound
turnTo(target)
move(1)
fire
endif
--
a tank executing that simple script will do only one at a time. For example, after move(1) is a fire command. The tank would not fire untill the move(1) command is finished.
But there is one problem; this is the first time either of us have done anything with reading a text file, and recognizing commands(and their arguments).
So my questions are, how do i read seperate lines of a txt and put them in a string array,
and, how do i recognize those as commands, with arguments?
the ifs might be a challenge too, but i’m mostly interested in the two points above, hoping i’ll manage to figure the rest out myself.
(PS: i’m thinking of suggesting the name Codeception to my friend :D)