Computer Science Canada Pacman Help |
Author: | monkeynamedsteve [ Thu May 11, 2006 1:39 pm ] | ||
Post subject: | Pacman Help | ||
I'm working on Pacman for my computers final and I've done pretty well so far with help from this site. Most things are working properly and all I need to add is ghosts and dots. When I added the first ghost this morning, it made Pacman flicker like crazy. I was wondering how to fix this, I've allredy tried View.Update, I don't know If I did it right. If anyone has suggestions on this or how to make the ghost have "a mind of its own". Right now, I hooked him up to the pacman movement just so that he moves around.
Any help on ghost movement, getting rid of the flicker or just general comments would be very much appreciated. |
Author: | monkeynamedsteve [ Thu May 11, 2006 2:31 pm ] |
Post subject: | |
Here's the file, makes it easier |
Author: | do_pete [ Thu May 11, 2006 2:36 pm ] |
Post subject: | |
Why do you have that for loop in your loop? |
Author: | monkeynamedsteve [ Thu May 11, 2006 2:45 pm ] |
Post subject: | |
Oh, hey, thanks. I had that in from before. I was trying several different approaches at the boundaries and I must have forgotten to get rid of it. |
Author: | Clayton [ Thu May 11, 2006 3:04 pm ] |
Post subject: | |
im not too sure why pacman flickers like that, but it might have something to do with the way you are drawing it, also, try and speed it up a tad (its waaaaaaaaaay slow) looks okay though, look forward to seeing it done ![]() |
Author: | monkeynamedsteve [ Thu May 11, 2006 3:10 pm ] |
Post subject: | |
Ya, I tried slowing it down to see if it would help the flickering. I promise to post the final program. |
Author: | Jenkinz [ Fri May 12, 2006 8:07 am ] |
Post subject: | |
yea, if you didn't see theres a for loop in your loop? |
Author: | do_pete [ Fri May 12, 2006 11:42 am ] |
Post subject: | |
do_pete wrote: Why do you have that for loop in your loop?
monkeynamedsteve wrote: Oh, hey, thanks. I had that in from before. I was trying several different approaches at the boundaries and I must have forgotten to get rid of it. I think he saw it. |
Author: | Clayton [ Fri May 12, 2006 4:24 pm ] |
Post subject: | |
now that i think about it, it might be that drawing the ghosts is slowing the computer down and causing a flicker from your erasing part (for pacman) because it is being drawn in black, and the slower speed is causing it to be seen, but i dont know for sure, i hope you figure it out ![]() |
Author: | monkeynamedsteve [ Fri May 12, 2006 5:49 pm ] |
Post subject: | |
Thanks alot Super Freak, that seems like the only reason I can think of. The school computers are slow and stupid, I think I'm just going to use sprites. What fun, need to learn about those. |
Author: | NikG [ Fri May 12, 2006 5:50 pm ] | ||||
Post subject: | |||||
I looked at the code you provided as a download, not what you posted in your first post. The reason pacman is flickering is that you have 2 View.Updates. You should use only one! It's an easy fix though. Change it from:
Notice how I moved ghost above the View.Update and removed the second delay. |
Author: | monkeynamedsteve [ Fri May 12, 2006 5:55 pm ] |
Post subject: | |
Thank you so much, you saved me so much time. It works so smoothly now. I'm gonna give you 5 bits casue I'm never gonna use them. |