|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
Hello!
I'm doing a project for college where you have to do a pacman clone. Until now I've done the menu with the options and right now the credits(last option) and "play"(option 1) are the ones who are working. My pacman symbol is the > (for pacman going to right); <(for pacman going left); ^(for pacman going up); v(for pacman going down). I need to create a labyrinth for pacman to go through and fill it with dots(which are the points of the game) that pacman will eat. Right now I'm having some problems trying to make pacman go left or right as he only moves up.Also when moving pacman (the direction keys are 8 for up) up he ,goes up the screen and I want to keep him inside the labyrinth and not go through it...Just one more question,how do I code the game so that when the up,right,left and down arrow keys are pressed he moves?Are these considered extended keys? Thanks in advance for any help! |
|
#2
|
|||
|
|||
|
Quote:
With regards to the labyrinth(grid), you'll need to determine how big you want it in 2 dimensions. Personally, I would make it something like 27x27. This would mean an area of 25x25 as you would then have a surrounding "zone" that can be used for checking if the pacman can move. You could allocate each spot in the grid a number to determine what access the pacman has to that spot. eg 0 could mean the pacman has full access to the spot - meaning they could enter that spot from any direction. Then allocate each side like such - up = 1, down = 2, left = 4, right = 8. This way you only need to allocate one number for each slot to enable you to determine the access to the spot. 0 = open 1 = no access from above this spot 2 = no access from below this spot 3 = no access from above or below 4 = no access from the left 5 = no access from above or left 6 = no access from below or left 7 = no access from above, below or left 8 = no access from the right . . . 15 = would mean no access to this spot from any direction (useful for the boundary spots) This would mean you could store various "maps" in a small amount of space, or create randomly generated "maps" based on some fairly simple logic. Hope that helps give you some ideas. Also, if I remember correctly the original pacman had a tunnel/transporter that allowed the pacman to move from the left to the right ( and back ). Something to add in too. |
|
#3
|
|||
|
|||
|
...
Thanks for the tips,but still,I'm not quite understanding how it should be done!
Well our project has some specifications like,for example the labyrinth has to be 25x20,pacman should start in the corner. Besides the pacman problem I have yet other problems which are filling the labyrinth with dots that pacman will eat and drawing walls inside the labyrinth(like a maze). On the menu I used interrupt 21,function 09 to put the options on the screen and I wanted to do the same with the labyrinth walls.Is there a function and interrupt that lets me put one character at a given location on the screen,instead of using the 0B800h video offset? Thanks in advance for all the help!It's much appreciated ![]() |
|
#4
|
|||
|
|||
|
Anyone could give me a hand?
![]() |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Other Programming Languages > Pacman assembly |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|