[J2ME]Development the GAME ARCOIDE

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • manjava
    New Member
    • Sep 2009
    • 132

    [J2ME]Development the GAME ARCOIDE

    HELLO,

    am developpement the mini game of arcoide on j2ME but i don't know any web site talk about the programming the game on the J2ME please if u know some url of the web talk about the begining developpement the game of the type arcoide tell me

    Thanks
  • RedSon
    Recognized Expert Expert
    • Jan 2007
    • 4980

    #2
    Did you google "java game development"?

    If not you should start there.

    Comment

    • manjava
      New Member
      • Sep 2009
      • 132

      #3
      thnaks if u know some link about the game call Arcade such as this picture in joint please help me
      Attached Files

      Comment

      • RedSon
        Recognized Expert Expert
        • Jan 2007
        • 4980

        #4
        We will program an applet in which a ball is moving from the left to the right hand side. I know this is nothing BIG but if you want to learn how to program games it is maybe the most important thing to understand how to animate objects!

        At the beginning we have to write our basic structure of an applet again but we will add two little things. Our applet has to implement the interface Runnable and the corrosponding method run() to animate a object. The structure of the applet should look like this:
        Code:
        import java.applet.*; 
        import java.awt.*; 
        
        public class BallApplet extends Applet implements Runnable 
        { 
        public void init() { } 
        
        public void start() { } 
        
        public void stop() { } 
        
        public void destroy() { } 
        
        public void run () { } 
        
        public void paint (Graphics g) { } 
        
        
        }
        More information here: http://www.javacooperation.gmxhome.d...wegungEng.html

        Original: http://forums.techarena.in/software-...nt/1252647.htm
        Last edited by Frinavale; Oct 15 '09, 07:38 PM. Reason: Added code tags......

        Comment

        • manjava
          New Member
          • Sep 2009
          • 132

          #5
          Please i want exemple some the picture please help

          Comment

          • RedSon
            Recognized Expert Expert
            • Jan 2007
            • 4980

            #6
            You are not going to find an example. You need to learn the basics.

            Try the following link and do a bit of exploring. If you have specific problems that you need help with respond. Otherwise to don't bother posting another remark asking for generalized help. There are other forums for generalized help.

            Comment

            • manjava
              New Member
              • Sep 2009
              • 132

              #7
              hello ,

              i want to move the racket of the top to the right some
              Attached Files

              Comment

              • RedSon
                Recognized Expert Expert
                • Jan 2007
                • 4980

                #8
                That's a racket? It looks like a piece of lawn. Are you trying to bounce steel ball bearings off of grass? I don't think a ball bearing would bounce off of sod like that.

                Comment

                • manjava
                  New Member
                  • Sep 2009
                  • 132

                  #9
                  please help me i am very nerve with this

                  Comment

                  • RedSon
                    Recognized Expert Expert
                    • Jan 2007
                    • 4980

                    #10
                    No, you are not asking for help, you are asking for a whole solution. What you want is someone to do the work for you so you can copy it to whatever application you are working on. When you say "I need an example" what you are really saying is "please someone write the code in a way that I direct you to do it so that I can then use that code in my project and take all the credit".

                    If you really want some help, copy your source code to the forum and highlight where the errors are occurring. Explain what you want it to do, explain what you *see* it doing.

                    Comment

                    • manjava
                      New Member
                      • Sep 2009
                      • 132

                      #11
                      thank you, juste i want to resolve with me this probleme i have a project that some of the game arcade but i want to work the game with two bouton not with 4 bouton
                      see my code :
                      Code:
                      protected void keyReleased(int keyCode)
                          {
                              int actionKey = getGameAction(keyCode);
                              if(actionKey == 5)
                              {
                                  j2mill_wall _tmp = wall;
                                  wall.setDir(1);
                              }
                              if(actionKey == 2)
                              {
                                  j2mill_wall _tmp1 = wall;
                                  wall.setDir(2);
                              }
                              if(actionKey == 6)
                              {
                                  j2mill_wall _tmp2 = wall;
                                  wall.setDir(4);
                              }
                              if(actionKey == 1)
                              {
                                  j2mill_wall _tmp3 = wall;
                                  wall.setDir(8);
                              }
                         }
                      }
                      and the class of direction
                      Code:
                      public class j2mill_wall
                      {
                      
                          private int dir;
                          public static final int DIR_NULL = 0;
                          public static final int DIR_RIGHT = 1;
                          public static final int DIR_LEFT = 2;
                          public static final int DIR_DOWN = 4;
                          public static final int DIR_UP = 8;
                      
                          public j2mill_wall()
                          {
                              dir = 0;
                          }
                      
                          public void setDir(int direction)
                          {
                              dir ^= direction;
                          }
                      
                          public void clearDir()
                          {
                              dir = 0;
                          }
                      
                          public boolean getDir(int direction)
                          {
                              int otherdir = 0;
                              if(direction == 1)
                              {
                                  otherdir = 2;
                              }
                              if(direction == 2)
                              {
                                  otherdir = 1;
                              }
                              if(direction == 8)
                              {
                                  otherdir = 4;
                              }
                              if(direction == 4)
                              {
                                  otherdir = 8;
                              }
                              return (dir & (direction | otherdir)) == direction;
                          }
                      }
                      thank you redson
                      Last edited by Frinavale; Oct 20 '09, 08:01 PM. Reason: Changed quote tags to code tags.

                      Comment

                      • RedSon
                        Recognized Expert Expert
                        • Jan 2007
                        • 4980

                        #12
                        If you only want two buttons then combine your if statements in keyReleased(). Then you can do something like:
                        Code:
                        if (actionkey is 2 || actionkey is 5)
                        {
                          if wall.getDir is 1
                              wall.setDir(2)
                          if wall.getDir is 2
                              wall.setDir(1)
                        }
                        You are just flipping between states that is all. Maybe some java guys can give you the correct code.

                        Comment

                        • manjava
                          New Member
                          • Sep 2009
                          • 132

                          #13
                          thank you but i don't resolve my probleme i change the keypressed but the game not work good and i return on neatbeans erreur :Uncaught exception: java.lang.NullP ointerException : 0
                          at j2mill.j2mill_c anvas.logic(j2m ill_canvas.java :285)
                          at j2mill.j2mill_c anvas.run(j2mil l_canvas.java:1 47)
                          at java.lang.Threa d.run(), bci=11

                          and my code
                          Code:
                          protected void keyPressed(int keyCode)
                              {
                                  int actionKey = getGameAction(keyCode);
                                  if(actionKey == 5 || actionKey == 2)
                                  {
                                     if (wall.getDir(1));
                                     wall.setDir(2);
                          
                                     if (wall.getDir(2));
                                     wall.setDir(1);
                                  }
                                  
                                  if(waittime == 0)
                                  {
                                      waiting = false;
                                  }
                              }
                          
                          
                          protected void keyReleased(int keyCode)
                              {
                                  int actionKey = getGameAction(keyCode);
                                  if(actionKey == 5)
                                  {
                                      j2mill_wall _tmp = wall;
                                      wall.setDir(1);
                                  }
                                  if(actionKey == 2)
                                  {
                                      j2mill_wall _tmp1 = wall;
                                      wall.setDir(2);
                                  }
                                  if(actionKey == 6)
                                  {
                                      j2mill_wall _tmp2 = wall;
                                      wall.setDir(4);
                                  }
                                  if(actionKey == 1)
                                  {
                                      j2mill_wall _tmp3 = wall;
                                      wall.setDir(8);
                                  }
                             }
                          thanks

                          Comment

                          • RedSon
                            Recognized Expert Expert
                            • Jan 2007
                            • 4980

                            #14
                            When is keypressed and keyreleased called? Your keyreleased call is clobbering the data you handled on keypressed. Do you use a debugger? If not you need to start because that will help you with a null pointer exception.

                            Comment

                            • manjava
                              New Member
                              • Sep 2009
                              • 132

                              #15
                              hello am lost mauch the time on this please if you can help me tell me how can resolve my probleme am debbugin and he done this message
                              Probleme with bar1
                              [WARN] [rms ] javacall_file_o pen: _wopen failed for: C:\Users\kamar\ javame-sdk\3.0\work\0\ appdb\00000002i cons#16#bar2_6P NG.tmp

                              Probleme with bar1
                              [WARN] [rms ] javacall_file_o pen: _wopen failed for: C:\Users\kamar\ javame-sdk\3.0\work\0\ appdb\00000002i cons2#16#bar11_ 6PNG.tmp

                              Probleme with bar11
                              [WARN] [rms ] javacall_file_o pen: _wopen failed for: C:\Users\kamar\ javame-sdk\3.0\work\0\ appdb\00000002i cons2#16#bar22_ 6PNG.tmp

                              Probleme with bar22
                              thank you

                              Comment

                              Working...