I've made a simple little text-based game that implements an extremely primitive menu. For it, I have designed a small option menu for attacks. Before, it used to automatically move on to the opponent's attack if you happened to use the gun attack if you were out of ammo, so I fixed that by adding a goto function that reverts back to the option menu before the enemy initiates it's attack.
I've read in some places that goto is unreliable, and indeed, shouldn't be used in most cases. I was just curious as to specifically why this is, and what alternative could I use?
- Viewing Profile: Topics: armitroner
Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics
Community Stats
- Group Members
- Active Posts 9
- Profile Views 751
- Member Title Member
- Age 14 years old
- Birthday December 4, 1998
-
Gender
Male
-
Location
In my house, durr.
132
Neutral
User Tools
Contacts
armitroner hasn't added any contacts yet.
Latest Visitors
Topics I've Started
C++ - Is Goto a Good Practice?
11 November 2012 - 06:31 PM
Need C++ Roguelike Tutorial
07 June 2012 - 09:05 AM
Despite my hunting the internets, my bounty hunter visor fails to locate any C++ tutorials for simple roguelikes.
Can anyone point me to a good roguelike tutorial for C++?
Thanks!
Can anyone point me to a good roguelike tutorial for C++?
Thanks!
Load of errors concerning 'console' function.
06 June 2012 - 11:12 AM
I was starting on programming my first game ever, a roguelike. I typed out the bare essentials, and I even have the help of a small tutorial, but when I tried to compile this, it gave errors such as:
I'm using the latest Eclipse for Mac OS X.
Here's the program's code:
Symbol 'console' could not be resolved. Symbol 'true' could not be resolved. Method 'Clear' could not be resolved. Method 'Position' could not be resolved. Program 'make' is not found in PATH.
I'm using the latest Eclipse for Mac OS X.
Here's the program's code:
#include <conio.h>
#include "Console.h"
int main( void )
{
console.Clear();
int nPlayerX=40, nPlayerY=12;
while( true )
{
//Output phase
console.Position( nPlayerX, nPlayerY );
console << '@';
//Input phase
char nKey = getch();
//Processing phase
switch( nKey )
{
//Move down
case 's':
nPlayerY++;
break;
//Move left
case 'a':
nPlayerX--;
break;
//Move right
case 'd':
nPlayerX++;
break;
//Move up
case "w":
nPlayerY--;
break;
//Quit
case 'q':
return 0;
break;
}
}
return 0;
}
- Home
- » Viewing Profile: Topics: armitroner

Find content