#include #include #include "GameChara.h" using std::cin; int main() { GameChara *hero = nullptr; int i = 0; while (true) { printf("%dフレーム目:無限\n", i); if (hero == nullptr) { printf("ヒーローが必要ですか?"); rewind(stdin); char n; cin >> n; if (n == 'y' || n == 'Y') { hero = new GameChara; } } if (hero != nullptr) { hero->Walk(UP); hero->PrintStatus(); //hero.Walk(UP); //hero.PrintStatus(); printf("ヒーローを葬りますか?"); rewind(stdin); char n; cin >> n; if (n == 'y' || n == 'Y') { delete hero; hero = nullptr; } } getchar(); i++; } return 0; }