![]() ![]() The "angry" state is also given a visual indicator.Īcts the same as he did in the original Pac-Man, but when powered up he gains the ability to make a morrored clone of himself along the Y-axis of the maze. If powered up, he gains a dash ability where he can dash after Pac-Man in horizontal tunnels. ![]() His Scatter Mode corner is the lower-left.Īcts identically to how he did in the original Pac-Man. During Scatter mode, she heads towards the upper-left corner.Ĭhases directly after Pac-Man, but tries to head to his Scatter corner when within an 8-Dot radius of Pac-Man. Due to a bug in the original game's coding, if Pac-Man faces upwards, Pinky's target will be 2 Pac-Dots in front of and 2 to the left of Pac-Man. He heads to the lower-right corner during Scatter mode.Ĭhases towards the spot 2 Pac-Dots in front of Pac-Man. His target is relative to both Blinky and Pac-Man, where the distance Blinky is from Pinky's target is doubled to get Inky's target. He also has an "angry" mode that is triggered when there are a certain number of dots left in the maze.ĭuring Chase mode, his target is a bit complex. Also, many Ghosts don't have proper official names, so those without will be marked with an unofficial name.įollows Pac-Man directly during Chase mode, and heads to the upper-right corner during Scatter mode. I'm not too good at Java.If a Ghost behaves identically to the original Pac-Man version, they won't be mentioned in an additional chart. (All of the above code is untested and may contain bugs. įor (int i=0 i.5, the ghosts will appear to chase after Pacman, but in a haphazard way. If you have an array steps with the first n_closing_in steps representing the steps that will take the ghost closer to Pacman, then you can assign those a total probability of prob_closing_in with double total_probility = 1. Then randomly pick a step, with higher probability assigned to those steps that will actually take it closer. That can be done with the Manhattan distance, which in a 2d grid is just the x distance + the y distance. Here's a possibility: for all steps that the ghost can take, compute whether that step will bring it closer to Pacman. (Please note I'm currently in a Grade 11 Computer Science course and halfway through the first semester ever of learned java.) Maybe some of you have programmed a pacman game or just know a good way for this. I'm wondering how I could make it do this and also have the ghosts sometimes stop and go another direction or something so that it's not always a constant chase and pacman has a chance to get away. (for example go to 10,14) Of course while avoiding going through walls like pacman. I'm currently using a 21 by 21 2D array for telling where walls are and such so I was thinking make it more try and head for the current grid location of pacman. My question to you smart people out there is what would be the best way to make the ghosts chase the pacman but sometimes randomly divert paths. ![]() I first want to work on the basics of getting the ghost to go after the pacman and not worry about there differences yet. I understand that the ghosts do not all have the same style of attack. I have a question about the ghosts though. I'm currently making a pacman game in java.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |