Results 1 to 3 of 3
  1. #1
    Java26 is offline Member
    Join Date
    Dec 2010
    Posts
    11
    Rep Power
    0

    Question pacman 2d array help please

    Hey all. i am trying to create pacman and have hit a road block. I have read that a 2d array can be used and filled with numbers that create a sort of grid overtop of the maze image i have. I know how to establish the array but i dont understand how to use it as a grid across my image, or how to tell the program to show the dots or walls by using the numbers in the array. Any help is very useful. Thanks everyone for your help!!!!

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    4,038
    Rep Power
    10

    Default

    You aren't really giving us enough information for us to help you. We have no idea how your system works or how it uses 2D arrays (it sounds like you're using a rudimentary engine of some kind).

    But think about it- take out a piece of paper and draw a grid on it. Now fill up the squares with either walls or dots. Isn't that pretty easy to translate to a 2D array?
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    Java26 is offline Member
    Join Date
    Dec 2010
    Posts
    11
    Rep Power
    0

    Default

    Right i understand the just of it. What i don't understand is how to implement it. Could you show me an example of how to set it up correctly? i understand that i can use flags in the array, followed by a slew of if statements to check where to show certain images based on what values are stored where in the array.

Similar Threads

  1. Huge problem. PacMan game.
    By Bullfrog in forum New To Java
    Replies: 3
    Last Post: 06-01-2010, 03:39 PM
  2. Help implementing Pacman
    By scheng12 in forum New To Java
    Replies: 2
    Last Post: 03-07-2010, 11:26 PM
  3. need help with pacman game!!
    By Newbie_Javaer in forum New To Java
    Replies: 2
    Last Post: 10-22-2009, 03:44 PM
  4. Replies: 3
    Last Post: 07-18-2009, 02:26 PM
  5. Java Pacman question
    By whdbstjr90 in forum New To Java
    Replies: 0
    Last Post: 12-12-2007, 12:28 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •