Thread: C++ Knowledge
View Single Post
Old 11-21-2011, 02:50 PM   #12
Vasu
Malingerer
 
Vasu's Avatar
 
Tournaments Won: 3

In-Game Name: None
Current Level: None
Server: None
Posts: 1,899
Vasu is just really niceVasu is just really niceVasu is just really niceVasu is just really niceVasu is just really nice
Actually, you can just add a single dimensional array as a property within the "location" class which holds 10 integers, each one corresponding to a particular direction. For example, the array could be:

{N,E,W,S,NE,NW,SE,SW,Up,Down}

For a particular room, the array might read:
{1,0,0,1,0,0,0,0,1,0} which means that he can move north, south and up, but not anywhere else.
__________________


Credits to Loveless for the great signature!
We rode on the winds of the rising storm
We ran to the sounds of thunder
We danced among the lightning bolts
And tore the world asunder

Vasu is offline   Reply With Quote