Njam documentation

 Njam is a full-featured cross-platform pacman-like game written in C++ using SDL library HOME >>


Contents


Game rules

There are two types of game: Duel and Cooperative.

In Duel games the goal is to win four games before other players do. To win a game, you have to be the player with most points. The points are gained by eating the cookies and ghosts. Each cookie is worth one point, each ghost is worth 5 points. If two players have the same points, the game is a draw. Eating ghosts is a tough task, you can do it only when you have superpower and even then the ghosts will try to run away. If the ghost kills a player, it's no big deal, he will revive, and show up on the screen few seconds later at the door. But be careful, if ghosts eat you too often,  your opponent might eat just about everything while you wait.

The points are shown at the right part of screen. They are represented by vertical bars which have the same colors as players. Under each bar, there is a thin grey line which shows how much points would player have if he eats all cookies that are on screen. When that thin line turns white, some of the players has enough points to win, and game can go to next level. Also, a triple-ding sound is heard at that moment. In fact, you can press ESC key anytime to finish current level, and the player with most points at that moment will be declared winner. Note not to press ESC when there are still some superpowers left, since some of the players can take it and kill many ghosts and gain a lot of points. However, if there isn't any superpower on the screen and the line turns white, just hit ESC, don't bother to finish the level.

In Cooperative games players don't compete, but cooperate. The goal of each level is to eat all cookies, and then advance to next level, until they complete the whole game. The players share a number of lives, and if ghost kills any of the players, one life is lost. When all lives are lost, the game is over. When playing in two, it's good idea to help each other by driving ghosts away. During each level players have a chance to win a life if they complete the level before the bonus-time runs out. The remaining time is shown at right part of the screen (vertical red bar).






The Ghosts


Ghosts are enemies of the players. They run around the screen and try to capture the player and kill him. If player has a superpower, then they run away from him, since superpower kills them. Ghosts spawn at the pentagram and run around. When a ghost dies, he returns to pentagram to recuperate, and after a while he's out again. There are three types of ghosts, which are recognized by their color and behavior:

Shaddy    

Shaddy is a blind ghost. He just moves randomly, and often makes turns at crossroads. He never turns back the same way he came, except sometimes when he hits the wall and forgets himself. However, he can feel the presence of superpower so he will run like hell from it, just like the other ghosts do. It is said that the worst thing that can happen to you is to be hunted by 2 or 3 shaddys since they are so unpredictable. Only the most skilled players who have a lot of luck can survive that kind of situations..

Hunter       

Hunter is the pursuit ghost. Something like a guard. He patrols around, and always goes straight, that is, he never turns sideways on cross-roads. If hunter spots you, he will turn your way at once, and hunt you down. If you are far enough, you still have a chance to hide behind some corner and avoid him. By exposing yourself to the hunter, he becomes your follower so you can use him as effective weapon. Hunters are most attracted by nearest player at their sight, so one can hide around the corner for a moment, just enough for hunter to start chasing someone else.

Assassin    

Assassin is the most dangerous creature. It just moves around like a shaddy, but if he sees you, he turns to hunter at once. If he loses you, he continues to run straight (just like hunter does) until he hits the wall and then goes back to shaddy mode. You can make assassin your follower too, but take care.





Level resources & stuff

Note: game elements look different with different skins, as you can see on this page.


Cookie    

Cookies are the goal of the game. Each cookie gives you one point, and the player with most points is the winner. You can also gain points by eating ghosts, where each eaten ghost gives you 5 points. If players have even points in a duel game, the game is a draw, and there is no winner.


Super-power (juice)      

When the player drinks this cool juice, he gains superpower which enables him to eat anything that moves: ghosts and even other players. Superpower lasts for a short period of time, and you can see small numbers 3,2,1... around player as superpower is about to run out. One cannot eat another player if the other has the superpower, nor can collect another juice if he has superpower already. In duel games, if player would try to take the superpower when he already has it, it will disappear and show up in the opposite corner of the screen. When ghosts see the player with superpower they run away, unless he is also invisible at the same time, which is a great combination if you want to kill a lot of ghosts. Player that has superpower is glowing red.


Invisibility    

As the name suggests, you are invisible to ghosts. Since shaddy is already blind, this does not affect him. When invisible, you can eat ghosts (if you have superpower) easily, since they will not run away. Invisibility lasts three times longer than superpower. Player which is invisible to ghosts is glowing yellow.


Teleport    

When a player walks into teleport, he is moved to one of the other teleports on screen. Teleport destination is chosen randomly. The player keeps his moving direction, and keeps moving, unless there is an obstacle in front of him. Ghosts just fly over teleports, so teleports can nicely be used to avoid ghosts when in deep trouble.


Freezer    

This cute gizmo freezes the ghosts for a short period of time. It lasts twice as long as superpower. Even though that ghosts cannot move during that time, they can still eat you, so beware.


Trap      

Trap is a spot on the ground where the player can pass only once. After that, the trap closes, and wall shows up at that place. You may try to close the trap and go back in same direction where you came from, but it may kill you. Ghosts are immune to traps, they do not activate neither can die of it. When a trap kills you, you are dead just like the ghosts got you. Only difference is that you have to wait twice longer to show up. Also, if the trap kills you, you will not lose a life.


The Door      

When the player is killed he leaves the game for a short period of time. After that time passes he comes back, and enters the game through the door. There is always one door on the screen. If the player is slammed by a trap the delay of showing up doubles, so be patient.


Pentagram (ghost-house)        

This is where ghosts come out from. Inactive pentagram is colored black. When ghost is about to came out of it, it turns yellow, so beware. Wandering around yellow pentagram is generally not a good idea, unless you have superpower on you.





Game controls and command line options

Player one (yellow player) uses cursor keys (up, down, left and right arrow) to move. Player two (green) uses keys R, F, D and G respectively. Players actually don't move, they just set the direction for their character, and as soon there is free space in that direction, he starts moving. Once you start moving, you cannot stop unless you hit the wall. When you host the network game, the controls are the same, but when you join it, then you're controlling players three and four (red and dark-green) with these same controls.

Other keys are P for pausing the game, and ESC to exit the game. If you press ESC in cooperative game, players will lose one life. In duel games, current game ends, and the player with most points at that moment is a winner. This is especially useful when there are some cookies left on screen, but they are impossible to reach.

The following command line options are available:
-w   starts the game in window (as opposed to fullscreen)
-h   uses hardware surfaces if possible (game runs faster, but there were problems with some graphic cards, so software surfaces are default)
-d   use DGA driver on Linux (much faster, but must run as root).
-?   Show summary of all command-line options.


next
 Adding custom level skins


Copyright ©
Milan Babuskov 2003.
Contact me at: mbabuskov@yahoo.com