Pacman Game in Assembly Language
Pacman Game in Assembly Language
The game we have developed in assembly language is based on the concept of pacman. First of all the first screen that appear is the name entering screen where the user needs to enter his name that must end with the full stop . .
After that the main game gets started where the instructions are written on the left side of the screen. The user moves his/her pacman by pressing left, right, up and down arrow keys. If in the middle of the game the user want to exit he simply needs to press Esc character. After pressing the Esc character the last screen get appeared where the name and the marks of the player will be displayed.
Main Logic Of The Game:The main logic that was used behind the whole concept of game is, the movement of the pacman is based on the arrow keys when left arrow key is pressed the column of the same row get decremented in the same way when right arrow key is pressed the column of the same row get incremented. But in the up arrow key the row of the same column get decremented and in the case of down arrow key the row of the same column get incremented. The idea of grains (.) is , the row and column position of all the grains are saved in the arrays along with their weight that was 5. When the player moves the pacman there is a check on the location that weather the location of the pacman is same as the grain location if yes then check the weight of the grain is 5 if yes again then inc in the marks of player and make the weight equal to 0 and move ahead. But if we get weight 0 instead of 5 its mean the location of the grain is detected but the grain is already eaten from here so dont do anything and move ahead. The same concept of row, column position and weight is used in the enemies sun and the leaf. Sun reduces one battery while leaf reduces 2 batteries along with the 5 marks. The battery size is four and the total chances are 2. When battery gets empty the player uses the chance and battery get filled again. When the one energy in the battery is only one character long it gives beep and also changes its color into red and start blinking. All this happens just to realize the player that he has a little battery left, so he should need to play with attention. When the pacman eats the enemy like sun or a leaf its color changes from yellow to red. In this game all this work is done, by using procedures. The first and the last page is in another files. They were included in the main program file and their procedures were called in the main program file. The major interup that is used in this game is int 10h other than that int 16h is used to get input from the user or player and int 21h is also used to perform other functionalities. The main functions of int 10h that were used are, set cursor position, get cursor position, print character on the cursor position e.t.c. So the major concepts of the game are described above. But the real instinct is playing the game. Hope youll enjoy while playing.