Computer Science Canada Pacman... |
Author: | florayu [ Sat Nov 27, 2010 8:19 pm ] | ||
Post subject: | Pacman... | ||
So , currently I am making a pacman game for my final project in Turing . I have set up the map , and all the boundaries when the user moves the pacman. However, with the setup of the map, i've placed the white dots as well, so as the pacman goes over the "dots", i draw over it with a black dot. But in that case, i also have my score increasing each time it moves in a certain direction while it draws the black dots . How can i do it so that it only increases the score when it colours over a white dot? How my code looks like:
% note that my map.txt looks something like : 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 3 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 3 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 3 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 3 3 3 3 3 3 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 |
Author: | TokenHerbz [ Sat Nov 27, 2010 8:29 pm ] |
Post subject: | RE:Pacman... |
first use your code tags so the code is easily readable in the post. UPDATE: THX: Now, in the OP you stated your answer, so try to convert that into code and put that into your game. if your score is adding more then you want it to, add more restrictions to it so that it ONLY adds when "CERTAINTY" happens. what is tile 3 = food? You could add a boolean value and use that to tell you if you've eaten the food or not, and change that value depending on white/black dots. should be easy to add into it. |