An Algorithmic and Social Introduction to Computer Science (CSC-105 2000S)

What feature do you most want to see in our PacMan game? Sketch a strategy we might use to implement that feature.


Well, this is a very interesting question.....and, to answer it, I'm going to recollect back to the days when my family used to own a Mrs. pac-man arcade. It was a great arcade, but as masterful at games that I am, it could have become rather tedious. Fortunately for me, what added more countless hours of enjoyment was a feature that our arcade came equipped with. It had a turbo button that altered the speed of the game.

The turbo button can serve two different purposes. It could give a turbo boost to (only) pac-man when activated or it can speed up the entire game (pacman and ghosts). To keep things simple (and so the button isn't a means of cheating), we'll use it to change the rate of the game.

I have no clue as to how the speed of "our" pac-man game is established. In any case, i would imagine that if we use a conditional statement in accordance to the loops controlling the movement of pac-man and the ghost (the rate at which the loops move the images). When the feature is activated, (If---then statement) the loops will change to run at a faster rate.



The feature I most want to see in our PacMan game is the ability to have more control over his movement. If I remember correctly from my brief look at the game, he is programmed to move continuously, and the only real control we have is changing his direction. I would like him to only move when the arrow buttons are pressed, in the direction of the one pressed. I have no idea what javascript we would need to use to implement this, but I imagine it would have to do with input from the keyboard, which I haven't worked with before!


I would like to see two things in the game: a point counter and actual evil PacMan eaters. Both seem like fairly easy things to do with the information we learned last week about Javascript. For the point counter, you could set up a status box programmed to add a particular number of points for each "treasure" collected. So when the PacMan is in a square with "treasure" in it, which would require revisiting the status information we included last time and connecting it to the formula for the status box. This may be more complicated to accomplish than I realize because the code would have to be written to know that a space is empty after the "treasure" is eaten? The evil guys could be programmed much like the PacMan, only they would be instructed to follow the direction of PacMan (something like, if PacMan is moving vertically Y, or horizontally X, then evil guy would move in Y or X direction), and if they catch up to PacMan, an alert should pop-up informing the player that the game is over.



A pause feature would be nice but I don't know anything about that. It might be: OnClick P, Program stops.

A feature that would also be nice, is if the picture of PacBill changed after eating the special button. The picture of Pac-Bill could change such that, the Pac-Bill moves at a faster rate or the Pac-Bill image source could change. Maybe a change in the picture could be something similar to this:

If position of Pac-Bill equals Row 2, Column 2, then for 10000 milliseconds image source for Pac-Bill equals X. If position of Pac-Bill equals special button, then for 10000 milliseconds image source for Pac-Bill equals X.

Also, the images on the screen could change for different reasons. The picture of Janet Reno could change as the game progresses or the walls could move. Most of the ideas I have in mind require the game to have a timer.


I want to see "bad guys" in the game. The only strategy I have is I think you could use the same algorithm to get them to move, but they would also have to move on their own, and be able to follow the "pacman" around wherever it goes. Also, when the "bad guys" touch the "pacman," the game ends. There also has to be multiple "bad guys." These are all just ideas based on how the real Pacman works, so you can use whatever ones you want, or whatever ones can be realistically accomplished in 50 minutes. I'm sorry I couldn't be more of help.



I would like it if the buttons to move the guy around were the arrow keys on the keyboard. I don't know how to do that in JavaScript, but I'm sure it can be done. I also wouldn't mind some walls to run around, rather than the open board.


Disclaimer Often, these pages were created "on the fly" with little, if any, proofreading. Any or all of the information on the pages may be incorrect. Please contact me if you notice errors.

This page may be found at

Source text last modified Wed Feb 16 08:16:05 2000.

This page generated on Fri Mar 17 09:11:00 2000 by Siteweaver. Validate this page's HTML.

Contact our webmaster at