The game will be written in C ++
Programming:
enemies.puch_back(new DefaultEnemy(200, 300, 3, 5)); enemies.puch_back(new DefaultEnemy(500, 400, 4, 5)); enemies.puch_back(new DefaultEnemy(300, 420, 3, 15)); enemies.at(2).createAward(new Key(4), "pling.wav");
Or interpret them from a file as follows:
DefaultEnemy 200 300 3 5 DefaultEnemy 500 400 4 5 DefaultEnemy 300 420 3 15 CreateAward 2 "pling.wav" Key 4
The program will be simpler, and people will not be able (not to mention hacking) to edit their levels. But can it be some trash to program it all? Are there other reasons for programming or interpretation?
What about memory management (if I have to go for interpretation)?
How to delete objects (games) when a level is unloaded?
c ++ interpreter
Martijn courteaux
source share