Sweet the player can move around in 2 dimensions.
What if he could like go to different rooms and stuff? That would be killer.
So the encountering an enemy algorithm is a little shallow, but what If I want to Divide up the grids and organize between them?Code:int _tmain(int argc, _TCHAR* argv[]) { World Adventursaur; int enemy = 15; do { Adventursaur.you.move(); enemy--; } while(enemy > 4); return 0; }
Code:Point move() { direction = _getch(); if (direction == 'w') y_location++; else if(direction == 'a') x_location--; else if(direction == 's') y_location--; else if(direction == 'd') x_location++; x_location = Bound(x_location, -10, 10); y_location = Bound(y_location, -10, 10); std::cout << x_location << ", " << y_location << std::endl; Point location; location.x = x_location; location.y = y_location; return location; }



LinkBack URL
About LinkBacks



