Hello, Im having a little issue with my 'roguelike' im working on, basicly I have this:
1 2 3 4 5 6 7 8 9 10 11 12
int MapArray[123][123] = {ETC}
void DrawMap( void )
{
for ( int y = 0; y < MAP_HEIGHT; y++)
{
console.SetPosition( 0, y );
for( int x =0; x < MAP_WIDTH; x++)
{
switch(MapArray[y][x])
{
And i want to do something like this:
1 2 3 4 5 6 7 8 9 10 11 12
Map=MapArray;
void DrawMap( void )
{
for ( int y = 0; y < MAP_HEIGHT; y++)
{
console.SetPosition( 0, y );
for( int x =0; x < MAP_WIDTH; x++)
{
switch(Map[y][x])
{
I have try'd many things, even that ^, But i cant work my head around it, any help will be appreciated
Thanks
My problem is as show above, switching maps, for instance, instead of having to do this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
If(Map==1)
{
void DrawMap( void )
{
for ( int y = 0; y < MAP_HEIGHT; y++)
{
console.SetPosition( 0, y );
for( int x =0; x < MAP_WIDTH; x++)
{
switch(MapArrayA[y][x])
{
if(Map==2)
{
etc
I want to be able to do this
1 2 3 4 5 6 7 8 9 10
void DrawMap( void )
{
for ( int y = 0; y < MAP_HEIGHT; y++)
{
console.SetPosition( 0, y );
for( int x =0; x < MAP_WIDTH; x++)
{
switch(Map[y][x])
{
And to change the map all i'd need to do is change the 'Map' for instance
int Map=MapArrayA;
But that does not work, see my problem? Sorry im fairly new to this...
Yeah, I see. You really should make a map class to make things easier.
But even when using raw arrays, you can pass in the map array you want to draw as a parameter: