Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

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.


Messages - Mr Random

Pages: [1]
1
General / Ghost pathfinding for Pacman help please.
« on: August 10, 2011, 02:41:44 am »
Thanks for the help guys.

I'm having 1 more issue with my pacman game which is probably easy to solve and im just missing the obvious.

Im trying to get the ghosts to move between two nodes smoothly. Is there a move to command or something i can easily do this with?

Also where can i read more on Boost.Graph? that sounds very interesting

2
General / Ghost pathfinding for Pacman help please.
« on: August 09, 2011, 03:44:32 am »
Hi guys I've been making a simple game of pacman. Currently I have the map, Pac-pills, Pac-man, Movement and Powerpills in the game all working as intended.

I'm trying to implement my first ghost and get him fully working before worrying about the others

I really need help making my ghost chase Pacman, After some research I'd like to use Dijkstra's algorithm and nodes but I cant figure out how to implement these into pacman.

I've found several tutorials that show how to use the algorithm, finding a path between 3 or 4 nodes.
 
The main things I'm having problems with is giving a node a position in my map, how to make the ghost move according to the nodes positions and how to detect which node is closest to the player.

Any help would be appreciated.

3
Graphics / Making a Map from a file, stack overload error
« on: July 31, 2011, 10:02:30 am »
I think I have an array that is to big. How can i fix this?
is there a command to put the array on the heap?
I know in c++ you can use new to add to an array but i haven't learn t much about using it yet, is this a good option to look into?

4
Graphics / Making a Map from a file, stack overload error
« on: July 31, 2011, 06:55:54 am »
Hi guys, i'm new to both SFML and c++. Im trying to make a dungeon crawler game, im having issues when i try to read from a file containing 1's and 0's (1 for a wall, 0 for blank square).

I'm reading the file into a 2D array and using this array to tell my array of sprites to draw the walls of the level.

Im using this code to read the file (I spent a while looking around these forums trying to get this to work so it may be wrong)
Code: [Select]

map.open("layout.txt");
while(map && y<80)
{
getline(map,line);
while(x<64)
{
Board[x][y]=line[x]-'0';
x++;
}
y++;
x=0;
}

That part seems to be working fine

To draw the sprites Im using the following

Code: [Select]

for(int i=0;i<64;++i)
{
for(int j=0;j<80;++j)
{
if(Board[i][j] == 1)
{
Map[i][j].SetImage (Wall);
Map[i][j].SetPosition (WallX,WallY);
WallX = WallX + 20;
}
WallY = WallY + 10;
}
}


When i run the program I get an error saying

Quote
Unhandled exception at 0x011b33d7 in Pacman.exe: 0xC00000FD: Stack overflow.


Then visual studio shows me pointing to the probe page line
Code: [Select]

; Find next lower page and probe
cs20:
        sub     eax, _PAGESIZE_         ; decrease by PAGESIZE
        test    dword ptr [eax],eax     ; probe page.
        jmp     short cs10


I assume the error is in the way Im making my walls, is there a better way to do this?

Pages: [1]