Other Programming Languages
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreOther Programming Languages

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old May 2nd, 2007, 05:23 PM
esmeco esmeco is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2006
Posts: 35 esmeco User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 h 16 m 54 sec
Reputation Power: 3
Arrow Assembly questions

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!

Reply With Quote
  #2  
Old May 2nd, 2007, 08:20 PM
Muzza Muzza is offline
/usr/bin/drinking
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 273 Muzza User rank is Second Lieutenant (5000 - 10000 Reputation Level)Muzza User rank is Second Lieutenant (5000 - 10000 Reputation Level)Muzza User rank is Second Lieutenant (5000 - 10000 Reputation Level)Muzza User rank is Second Lieutenant (5000 - 10000 Reputation Level)Muzza User rank is Second Lieutenant (5000 - 10000 Reputation Level)Muzza User rank is Second Lieutenant (5000 - 10000 Reputation Level)Muzza User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 5 Days 4 h 38 m 43 sec
Reputation Power: 73
Quote:
Originally Posted by esmeco
Hello!

I'm doing a project for college where you have to do a pacman clone.
Until now what I've done is the menu with the options and what is working right now is the credits(last option) and "play"(option 1).
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 and 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!I hope to learn something from you!


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.

Reply With Quote
  #3  
Old May 4th, 2007, 03:12 PM
esmeco esmeco is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2006
Posts: 35 esmeco User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 h 16 m 54 sec
Reputation Power: 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

Reply With Quote
  #4  
Old May 5th, 2007, 03:33 PM
esmeco esmeco is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2006
Posts: 35 esmeco User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 h 16 m 54 sec
Reputation Power: 3
Anyone could give me a hand?

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreOther Programming Languages > Pacman assembly


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway