1
Programming / Re: Just starting out, help appreciated.
« on: February 11, 2012, 02:17:54 PM »
That solved it, thanks very much.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
void ManaCommand( void )
{
// Draw some notification to the user
console.SetPosition( 60, 2 );
console << "1. Damage Enemy.";
console.SetPosition( 60, 4 );
console << "2. Heal yourself.";
console.SetPosition( 60, 6 );
console << "3. Open Door.";
console.SetPosition( 60, 8 );
console << "4. Chop Tree";
// Let the user decide where to look
char nKey = getch();
int nDeltaX = 0;
int nDeltaY = 0;
// Clear the screen to get rid of the notification text
console.Clear();
// Compute which tile the user specified
switch( nKey )
{
// Damage Enemy
case '1':
nDeltaX = 0;
nDeltaY = 1;
break;
// Heal yourself
case '2':
nDeltaX = -1;
nDeltaY = 0;
break;
// Open Door
case '3':
OpenDoorCommand();
break;
// Chop Tree
case '4':
ChopTreeCommand();
break;
// Not a valid direction
default:
// No direction specified, so abort
console.Clear();
return;
}