Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (579)
games submitted by our members
Games in WIP (500)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  CODE FOR THE MAZE  (Read 3313 times)
0 Members and 1 Guest are viewing this topic.
Offline game

Senior Newbie





« Posted 2009-03-17 14:32:51 »

 Grin HELLO, MY GAME IS PAC-MAN GAME. I WANT THE CODE TO BUILT THE MAZE FOR THE GAME.
Offline Markus_Persson

JGO Wizard


Medals: 12
Projects: 19


Mojang Specifications


« Reply #1 - Posted 2009-03-17 16:17:29 »

I don't think you're going to get much help, seeing as:

1) You're shouting
2) Your name is "game"
3) You're asking a very unspecific question

Are you asking what the best way to represent a map in memory is, or how to render it to screen, or are you asking about writing a level editor for building the maze?

Play Minecraft!
Offline DzzD
« Reply #2 - Posted 2009-03-17 16:23:45 »

yup yup

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline h3ckboy
« Reply #3 - Posted 2009-03-17 18:23:57 »

COULDNT HAVE SAID IT ANY BETTER MYSELF lol

no offense, but all caps just makes it look offensive.
Offline DzzD
« Reply #4 - Posted 2009-03-17 18:41:15 »

....

http://www.java-gaming.org/index.php?topic=20052.msg161192;topicseen#msg161192

Offline Eli Delventhal

JGO Kernel


Medals: 42
Projects: 12


Game Engineer


« Reply #5 - Posted 2009-03-17 18:43:56 »

http://www.otcsw.com/maze.php

All the source is there on that page and is free to use. It's an infinitely scalable maze generating/solving algorithm, although it won't work exactly for Pac-Man. You'll have to tweak it so that there's more than one solvable path to a single location.

In case you're curious what the maze generation algorithm is, it's called the "Drunkard's Walk" algorithm. It is tweaked to generate better mazes, however.
http://en.wikipedia.org/wiki/Random_walk

See my work:
OTC Software
Offline game

Senior Newbie





« Reply #6 - Posted 2009-03-21 08:46:43 »

 ;)than you, the maze which i want it called block grid maze which is use for pac-man
I have the code but it not work and there are many errors and I can not solve it.
I hope anyone have idea or the code can I used for my game. thanks
Offline Eli Delventhal

JGO Kernel


Medals: 42
Projects: 12


Game Engineer


« Reply #7 - Posted 2009-03-21 08:48:13 »

;)than you, the maze which i want it called block grid maze which is use for pac-man
I have the code but it not work and there are many errors and I can not solve it.
I hope anyone have idea or the code can I used for my game. thanks
I already gave you a link to the source code of an advanced maze generator. That's more than most will do, as your question is ambiguous and simply cannot be answered. Post a specific question with attached source and maybe you'll get a response.

See my work:
OTC Software
Offline game

Senior Newbie





« Reply #8 - Posted 2009-03-21 09:10:34 »

 :)thank you for the link, but I dont understand it, you have code is easy than this.
you know it is the first time I used java to create game
I am sorry because I ask so much persecutioncomplex
Offline gouessej

« In padded room »



TUER


« Reply #9 - Posted 2009-03-21 10:53:45 »

:)thank you for the link, but I dont understand it, you have code is easy than this.
you know it is the first time I used java to create game
I am sorry because I ask so much persecutioncomplex
Hi

Demonpants gave you some excellent suggestions. If you don't understand the source code, maybe you should rather improve your skills in Java and algorithmic before attempting to create a game. On my view, yes, you ask too much. You can look at sourceforge.net, there are some other examples of PacMan in Java and in other languages.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Eli Delventhal

JGO Kernel


Medals: 42
Projects: 12


Game Engineer


« Reply #10 - Posted 2009-03-21 20:46:37 »

The maze generator class is not very long at all. See, I can post the whole thing within a single JGO post. It's also well commented. And for you experienced JGOers, I know I do some lazy things in this code. This also tends to generates mazes where the solution goes from top-left to bottom-left to bottom-right because it generates it through for loops. I have a much improved version but it's significantly more complicated, so I figured now is not the time to show it. Smiley

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67  
68  
69  
70  
71  
72  
73  
74  
75  
76  
77  
78  
79  
80  
81  
82  
83  
84  
85  
86  
87  
88  
89  
90  
91  
92  
93  
94  
95  
96  
97  
98  
99  
100  
101  
102  
103  
104  
105  
106  
107  
108  
109  
110  
111  
112  
113  
114  
115  
116  
117  
118  
119  
120  
121  
122  
123  
124  
125  
126  
127  
128  
129  
130  
131  
132  
133  
134  
135  
136  
137  
138  
139  
140  
141  
142  
143  
144  
145  
146  
147  
148  
149  
150  
151  
152  
153  
154  
155  
156  
157  
158  
159  
160  
161  
162  
163  
164  
165  
166  
167  
168  
169  
170  
171  
172  
173  
174  
175  
176  
177  
178  
179  
180  
181  
182  
183  
184  
185  
186  
187  
188  
189  
190  
191  
192  
193  
194  
195  
196  
197  
198  
199  
200  
201  
202  
203  
204  
205  
206  
207  
208  
package mm;

/**
 * This class generates a random solvable maze by first filling in a maze with walls,
 * then charting a path from the start to the finish (top left to bottom right), then
 * giving every other piece of the path a random number of exits, until every
 * space has been evaluated.
 * @author Eli Delventhal
 *
 */


//import java.util.Stack;
import java.util.ArrayList;

public class MazeGenerator
{
   //Can be changed for mazes that are more than two dimensions.
  public static final int NUM_DIRECTIONS = 4;
   
   //The indeces for the different possible directions. Add more for
  //mazes that are more than two dimensions.
  public static final int UP = 0;
   public static final int LEFT = 1;
   public static final int RIGHT = 2;
   public static final int DOWN = 3;
   
   /**
    * Generates a random solvable maze with the top left corner as the start,
    * with no goal yet specified. The maze has the specified width and height
    * in terms of number of rooms, and is awlays rectangular.
    * @param width      The width of the maze.
    * @param height   The height of the maze.
    * @return         A solvable maze with the matched width and height.
    */

   public static Room[][] generateMaze(int width, int height)
   {
      return generateMaze(width,height,null);
   }
   
   /**
    * Generates a random solvable maze with the top left corner as the start,
    * with no goal yet specified. The maze has the specified width and height
    * in terms of number of rooms, and is awlays rectangular.
    * @param width      The width of the maze.
    * @param height   The height of the maze.
    * @param frame      The JFrame that should be repainting. If null, no pausing or painting.
    * @return         A solvable maze with the matched width and height.
    */

   public static Room[][] generateMaze(int width, int height, Main frame)
   {
      //Initialize the maze with no rooms at all (all set to null).
     Room[][] maze = new Room[width][height];
     
      //Visit all spaces in the maze at least once.
     for (int i = 0; i < width; i++)
      {
         for (int j = 0; j < height; j++)
         {
            //As we get to a point in the maze, we need to create a room there
           //if there isn't one. Then we need to construct a path from that room.
           if (maze[i][j] == null)
               constructRoom(maze,i,j,new ArrayList<Integer>(),frame);
           
            //If there is already a room, we simply skip onwards.
        }
      }
     
     
      return maze;
   }
   
   /**
    * Constructs a room of the maze at the specified i and j positions.
    * It will then continue to call itself until it reaches a point
    * where it can no longer create more rooms.
    * @param maze   The maze to work with.
    * @param i      The i position to start with.
    * @param j      The j position to start with.
    * @param checkedDirs The directions that have already been checked.
    * @param frame   The frame to tell to repaint.
    */

   private static void constructRoom(Room[][] maze, int i, int j, ArrayList<Integer> checkedDirs, Main frame)
   {
      //If all four directions have been tried, return from the function.
     if (checkedDirs.size() >= NUM_DIRECTIONS)
         return;
     
      //If we don't already have a room here, create one.
     if (maze[i][j] == null)
         addNewRoom(maze,i,j,frame);
     
      //Open up a random direction for this room. If that
     //direction already has a room,
     //try a different direction. If there is no room there,
     //call this function at the new position.
     int direction = (int) (Math.random() * NUM_DIRECTIONS);
      if (!checkedDirs.contains(direction))
      {
         //Add the current direction to the ones checked.
        checkedDirs.add(direction);
         
         //Create delta i and delta j variables to map change.
        int di = 0;   int dj = 0;
         if (direction == UP)
            di = -1;
         else if (direction == DOWN)
            di = 1;
         else if (direction == LEFT)
            dj = -1;
         else if (direction == RIGHT)
            dj = 1;
         
         //If the change will take us out of bounds, try again.
        if (i + di < 0 || i + di >= maze.length || j + dj < 0 || j + dj >= maze[0].length)
            constructRoom(maze,i,j,checkedDirs,frame);
         //Otherwise, it's okay to go in our direction.
        else
         {
            //If there isn't a room there, call the function with no checked dirs.
           if (maze[i+di][j+dj] == null)
            {
               maze[i][j].open[direction] = true;
               constructRoom(maze,i+di,j+dj,new ArrayList<Integer>(),frame);
            }
            //If there is already a room there, try again.
           else
               constructRoom(maze,i,j,checkedDirs,frame);
         }
      }
      else
         constructRoom(maze,i,j,checkedDirs,frame);
   }
   
   /**
    * Adds a new room to the maze, linking it to adjacent rooms correctly.
    * @param maze   The maze.
    * @param i      The i position to add in.
    * @param j      The j position to add in.
    */

   private static void addNewRoom(Room[][] maze, int i, int j, Main frame)
   {
      maze[i][j] = new Room(i,j);
      boolean linked = false;
      //Search for adjacent rooms already linked to this one and link back to them.
     if (i > 0 && maze[i-1][j] != null && maze[i-1][j].open[DOWN])
      {
         maze[i][j].open[UP] = true;
         linked = true;
      }
      if (i < maze.length-1 && maze[i+1][j] != null && maze[i+1][j].open[UP])
      {
         maze[i][j].open[DOWN] = true;
         linked = true;
      }
      if (j > 0 && maze[i][j-1] != null && maze[i][j-1].open[RIGHT])
      {
         maze[i][j].open[LEFT] = true;
         linked = true;
      }
      if (j < maze[0].length-1 && maze[i][j+1] != null && maze[i][j+1].open[LEFT])
      {
         maze[i][j].open[RIGHT] = true;
         linked = true;
      }
     
      //If it wasn't linked to anything, link it to a random adjacent room.
     //Make sure an adjacent room exists first.
     if ((i > 0 && maze[i-1][j] != null) || (i < maze.length-1 && maze[i+1][j] != null) || (j > 0 && maze[i][j-1] != null) || (j < maze[0].length-1 && maze[i][j+1] != null))
      {
         while (!linked)
         {
            double random = Math.random() * 4;
            if (random <= 1 && i > 0 && maze[i-1][j] != null)
            {
               maze[i][j].open[UP] = true;
               maze[i-1][j].open[DOWN] = true;
               linked = true;
            }
            else if (random <= 2 && i < maze.length-1 && maze[i+1][j] != null)
            {
               maze[i][j].open[DOWN] = true;
               maze[i+1][j].open[UP] = true;
               linked = true;
            }
            else if (random <= 3 && j > 0 && maze[i][j-1] != null)
            {
               maze[i][j].open[LEFT] = true;
               maze[i][j-1].open[RIGHT] = true;
               linked = true;
            }
            else if (random <= 4 && j < maze[0].length-1 && maze[i][j+1] != null)
            {
               maze[i][j].open[RIGHT] = true;
               maze[i][j+1].open[LEFT] = true;
               linked = true;
            }
         }
      }
     
      //Tell the main class to paint if it has been specified.
     if (frame != null)
      {
         frame.setMaze(maze);
         frame.repaint();
         try {Thread.sleep(frame.getDrawDelay());} catch(Exception e) {}
      }
   }
}


Here is the Room class it relies on.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
package mm;

/**
 * A Room is a very simple object that contains 4 booleans determining where it has
 * walls. These walls can be at the north, south, east, or west. These are public
 * instance variables for simplicity's sake. By default, a room is entirely closed.
 * @author Eli Delventhal
 *
 */

public class Room
{
   public boolean[] open;
   public int i;
   public int j;
   
   public Room(int ni, int nj)
   {
      open = new boolean[MazeGenerator.NUM_DIRECTIONS];
      i = ni;
      j = nj;
   }
}


It's also incredibly complicated.  Tongue

If you can't get your head around those, you've got some more learning to do. Why not start with pre-made levels so you can practice Java then come back to more advanced techniques later? Or why not just download my source, run it on your machine, then edit it so you have  Pac-Man running around? The best way to learn it all is to mess around with it, rather than simply staring at it and saying "I don't understand this."

See my work:
OTC Software
Offline game

Senior Newbie





« Reply #11 - Posted 2009-03-22 15:01:32 »

 Cheesy thank you very much
I will try the bast to do it
thannnnnk you for your help
Offline Eli Delventhal

JGO Kernel


Medals: 42
Projects: 12


Game Engineer


« Reply #12 - Posted 2009-03-22 19:40:02 »

Cheesy thank you very much
I will try the bast to do it
thannnnnk you for your help
By the way, that was copy/pasted from the link I already gave you.  Roll Eyes

The only difference here is that you didn't need to open a zip file.

See my work:
OTC Software
Offline h3ckboy
« Reply #13 - Posted 2009-03-23 17:25:43 »

By the way, that was copy/pasted from the link I already gave you.  Roll Eyes

The only difference here is that you didn't need to open a zip file.

people are very lazy (me included Grin)
Offline game

Senior Newbie





« Reply #14 - Posted 2009-03-25 05:55:50 »

 Cheesy hellow how are you master Demonpants
I read the code which you gave it to me and I run on my machine, but the are errors

public static Room[][] generateMaze(int width, int height, [size=10pt]Main frame[/size])

in [size=10pt]Main frame[/size]
what you mean (main frame) and it not delacer (what it's type)
Offline Eli Delventhal

JGO Kernel


Medals: 42
Projects: 12


Game Engineer


« Reply #15 - Posted 2009-03-25 08:17:45 »

Cheesy hellow how are you master Demonpants
I read the code which you gave it to me and I run on my machine, but the are errors

public static Room[][] generateMaze(int width, int height, [size=10pt]Main frame[/size])

in [size=10pt]Main frame[/size]
what you mean (main frame) and it not delacer (what it's type)
I thought you might ask that. This is simply a reference to the main window in the app that the maze generator is included in so that you can visually see what is happening as it is created (it updates the draw to reflect the maze). You can delete all the references to Main as well as that parameter.

See my work:
OTC Software
Offline game

Senior Newbie





« Reply #16 - Posted 2009-03-25 11:09:47 »

 Cry I know I asked too much but I don't understand what you main
I will tell some thing I am just student and I don't have iead how to do game by java
but what can I do, because the pac-man game is my project and I must submit after two weeks
can you help me
I am ready to learn more to do it
 
Offline erikd

JGO Ninja


Medals: 15
Projects: 4
Exp: 14 years


Maximumisness


« Reply #17 - Posted 2009-03-25 14:55:49 »

Quote
but what can I do, because the pac-man game is my project and I must submit after two weeks
Oh my, you're in trouble  Tongue

If I were in your position, I'd (given the little time you have left):
1) Learn the very basics of java. The java tutorial is a good starting point: http://java.sun.com/docs/books/tutorial/
2) Go to http://javaboutique.internet.com/PacMan/. There's a pacman applet there with source code included.
3) Study the source and try to get a raw understanding
4) Implement something similar yourself.

If all fails, just hack your own name in there and submit it to your teacher persecutioncomplex Grin
(just kidding, of course! I'd tell on you if you did  Wink)

Offline Eli Delventhal

JGO Kernel


Medals: 42
Projects: 12


Game Engineer


« Reply #18 - Posted 2009-03-25 20:30:08 »

By deleting all the references to Main, you would for example do this:

//Was this:
Main main;
foo(bar);

//Becomes this:
foo(bar);

If you know how to use a word processor you should be able to delete any references (should I say "mentions" to be more understandable) to Main.

That's with all the references deleted. If you can't solve such a simple type of syntax error and didn't understand what I meant about deleting the references, you should probably not be working on Pac-Man. Instead, start with something like a bunch of balls bouncing around. Note that the program I linked was one of the very first "games" I made in Java. You've got to start a lot smaller than Bomberman or you'll just be pulling your hair out. Also, I slowly over time added on to this bounce ball game, I didn't do it all at once. As I learned different things I would implement them.
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67  
68  
69  
70  
71  
72  
73  
74  
75  
76  
77  
78  
79  
80  
81  
82  
83  
84  
85  
86  
87  
88  
89  
90  
91  
92  
93  
94  
95  
96  
97  
98  
99  
100  
101  
102  
103  
104  
105  
106  
107  
108  
109  
110  
111  
112  
113  
114  
115  
116  
117  
118  
119  
120  
121  
122  
123  
124  
125  
126  
127  
128  
129  
130  
131  
132  
133  
134  
135  
136  
137  
138  
139  
140  
141  
142  
143  
144  
145  
146  
147  
148  
149  
150  
151  
152  
153  
154  
155  
156  
157  
158  
159  
160  
161  
162  
163  
164  
165  
166  
167  
168  
169  
170  
171  
172  
173  
174  
175  
176  
177  
178  
179  
180  
181  
182  
/**
 * This class generates a random solvable maze by first filling in a maze with walls,
 * then charting a path from the start to the finish (top left to bottom right), then
 * giving every other piece of the path a random number of exits, until every
 * space has been evaluated.
 * @author Eli Delventhal
 *
 */


import java.util.ArrayList;

public class MazeGenerator
{
   //Can be changed for mazes that are more than two dimensions.
  public static final int NUM_DIRECTIONS = 4;
   
   //The indeces for the different possible directions. Add more for
  //mazes that are more than two dimensions.
  public static final int UP = 0;
   public static final int LEFT = 1;
   public static final int RIGHT = 2;
   public static final int DOWN = 3;
   
   /**
    * Generates a random solvable maze with the top left corner as the start,
    * with no goal yet specified. The maze has the specified width and height
    * in terms of number of rooms, and is awlays rectangular.
    * @param width      The width of the maze.
    * @param height   The height of the maze.
    * @return         A solvable maze with the matched width and height.
    */

   public static Room[][] generateMaze(int width, int height)
   {
      //Initialize the maze with no rooms at all (all set to null).
     Room[][] maze = new Room[width][height];
     
      //Visit all spaces in the maze at least once.
     for (int i = 0; i < width; i++)
      {
         for (int j = 0; j < height; j++)
         {
            //As we get to a point in the maze, we need to create a room there
           //if there isn't one. Then we need to construct a path from that room.
           if (maze[i][j] == null)
               constructRoom(maze,i,j,new ArrayList<Integer>());
           
            //If there is already a room, we simply skip onwards.
        }
      }
     
     
      return maze;
   }
   
   /**
    * Constructs a room of the maze at the specified i and j positions.
    * It will then continue to call itself until it reaches a point
    * where it can no longer create more rooms.
    * @param maze   The maze to work with.
    * @param i      The i position to start with.
    * @param j      The j position to start with.
    * @param checkedDirs The directions that have already been checked.
    */

   private static void constructRoom(Room[][] maze, int i, int j, ArrayList<Integer> checkedDirs)
   {
      //If all four directions have been tried, return from the function.
     if (checkedDirs.size() >= NUM_DIRECTIONS)
         return;
     
      //If we don't already have a room here, create one.
     if (maze[i][j] == null)
         addNewRoom(maze,i,j);
     
      //Open up a random direction for this room. If that
     //direction already has a room,
     //try a different direction. If there is no room there,
     //call this function at the new position.
     int direction = (int) (Math.random() * NUM_DIRECTIONS);
      if (!checkedDirs.contains(direction))
      {
         //Add the current direction to the ones checked.
        checkedDirs.add(direction);
         
         //Create delta i and delta j variables to map change.
        int di = 0;   int dj = 0;
         if (direction == UP)
            di = -1;
         else if (direction == DOWN)
            di = 1;
         else if (direction == LEFT)
            dj = -1;
         else if (direction == RIGHT)
            dj = 1;
         
         //If the change will take us out of bounds, try again.
        if (i + di < 0 || i + di >= maze.length || j + dj < 0 || j + dj >= maze[0].length)
            constructRoom(maze,i,j,checkedDirs);
         //Otherwise, it's okay to go in our direction.
        else
         {
            //If there isn't a room there, call the function with no checked dirs.
           if (maze[i+di][j+dj] == null)
            {
               maze[i][j].open[direction] = true;
               constructRoom(maze,i+di,j+dj,new ArrayList<Integer>());
            }
            //If there is already a room there, try again.
           else
               constructRoom(maze,i,j,checkedDirs);
         }
      }
      else
         constructRoom(maze,i,j,checkedDirs);
   }
   
   /**
    * Adds a new room to the maze, linking it to adjacent rooms correctly.
    * @param maze   The maze.
    * @param i      The i position to add in.
    * @param j      The j position to add in.
    */

   private static void addNewRoom(Room[][] maze, int i, int j)
   {
      maze[i][j] = new Room(i,j);
      boolean linked = false;
      //Search for adjacent rooms already linked to this one and link back to them.
     if (i > 0 && maze[i-1][j] != null && maze[i-1][j].open[DOWN])
      {
         maze[i][j].open[UP] = true;
         linked = true;
      }
      if (i < maze.length-1 && maze[i+1][j] != null && maze[i+1][j].open[UP])
      {
         maze[i][j].open[DOWN] = true;
         linked = true;
      }
      if (j > 0 && maze[i][j-1] != null && maze[i][j-1].open[RIGHT])
      {
         maze[i][j].open[LEFT] = true;
         linked = true;
      }
      if (j < maze[0].length-1 && maze[i][j+1] != null && maze[i][j+1].open[LEFT])
      {
         maze[i][j].open[RIGHT] = true;
         linked = true;
      }
     
      //If it wasn't linked to anything, link it to a random adjacent room.
     //Make sure an adjacent room exists first.
     if ((i > 0 && maze[i-1][j] != null) || (i < maze.length-1 && maze[i+1][j] != null) || (j > 0 && maze[i][j-1] != null) || (j < maze[0].length-1 && maze[i][j+1] != null))
      {
         while (!linked)
         {
            double random = Math.random() * 4;
            if (random <= 1 && i > 0 && maze[i-1][j] != null)
            {
               maze[i][j].open[UP] = true;
               maze[i-1][j].open[DOWN] = true;
               linked = true;
            }
            else if (random <= 2 && i < maze.length-1 && maze[i+1][j] != null)
            {
               maze[i][j].open[DOWN] = true;
               maze[i+1][j].open[UP] = true;
               linked = true;
            }
            else if (random <= 3 && j > 0 && maze[i][j-1] != null)
            {
               maze[i][j].open[LEFT] = true;
               maze[i][j-1].open[RIGHT] = true;
               linked = true;
            }
            else if (random <= 4 && j < maze[0].length-1 && maze[i][j+1] != null)
            {
               maze[i][j].open[RIGHT] = true;
               maze[i][j+1].open[LEFT] = true;
               linked = true;
            }
         }
      }
   }
}


Note I did not test this at all. I just deleted. Took me 2 minutes.

See my work:
OTC Software
Offline h3ckboy
« Reply #19 - Posted 2009-03-26 20:33:00 »

Oh my, you're in trouble  Tongue

If I were in your position, I'd (given the little time you have left):
1) Learn the very basics of java. The java tutorial is a good starting point: http://java.sun.com/docs/books/tutorial/
2) Go to http://javaboutique.internet.com/PacMan/. There's a pacman applet there with source code included.
3) Study the source and try to get a raw understanding
4) Implement something similar yourself.

If all fails, just hack your own name in there and submit it to your teacher persecutioncomplex Grin
(just kidding, of course! I'd tell on you if you did  Wink)

if he didn't know the basics of java, his teacher would have to be insane to ask him to program a game.
Offline cylab

JGO Knight


Medals: 34



« Reply #20 - Posted 2009-03-26 20:54:11 »

It looks, like he slept all day in school and now want to get his marks by asking the net to compensate his omission...

Mathias - I Know What [you] Did Last Summer!
Offline erikd

JGO Ninja


Medals: 15
Projects: 4
Exp: 14 years


Maximumisness


« Reply #21 - Posted 2009-03-27 10:42:57 »

if he didn't know the basics of java, his teacher would have to be insane to ask him to program a game.

Quote
It looks, like he slept all day in school and now want to get his marks by asking the net to compensate his omission...

Either way, to me it doesn't look like he knows the basics of java.

Offline h3ckboy
« Reply #22 - Posted 2009-03-27 17:24:25 »

Either way, to me it doesn't look like he knows the basics of java.

fair enough.
Offline game

Senior Newbie





« Reply #23 - Posted 2009-03-29 15:28:44 »

 :)than you my dears
I got the source code of pac-man and I download some java books  and I read it .
I  understand some basic iead about java and the basic concepts in the java.
I will do the bast in my project.
than you for your help
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (35 views)
2014-04-15 18:08:23

BurntPizza (31 views)
2014-04-15 03:46:01

UprightPath (46 views)
2014-04-14 17:39:50

UprightPath (29 views)
2014-04-14 17:35:47

Porlus (46 views)
2014-04-14 15:48:38

tom_mai78101 (67 views)
2014-04-10 04:04:31

BurntPizza (127 views)
2014-04-08 23:06:04

tom_mai78101 (227 views)
2014-04-05 13:34:39

trollwarrior1 (192 views)
2014-04-04 12:06:45

CJLetsGame (199 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!