Java-Gaming.org Hi !
Featured games (81)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (119)
games submitted by our members
Games in WIP (575)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Game Development / Newbie & Debugging Questions / calling repaint() in static method? on: 2007-01-17 02:26:28
is there any way? or there isn't? Huh
2  Game Development / Networking & Multiplayer / Re: User ID on: 2007-01-08 02:16:58
thanks i will take a look at it =)
3  Game Development / Networking & Multiplayer / Re: User ID on: 2007-01-04 03:25:38
hi i would like to ask you if you mind posting the part in the code which does the mapping of userid to username?

i am getting confused

thanks
4  Game Development / Networking & Multiplayer / Re: PSP on: 2007-01-04 03:07:14
i am planning to try it out there, u can try creating a game first to communicate with ip by wireless then u can start puting the client into the psp, i am planning to try out on psp using peejay
5  Game Development / Newbie & Debugging Questions / Re: Any idea why my desktopPane doesn't show up? on: 2006-12-27 02:10:01
was using JdesktopPane to call JInternalFrame

thanks

tried requestFocusInWindow(); doesn't work ;
6  Game Development / Newbie & Debugging Questions / Re: Any idea why my desktopPane doesn't show up? on: 2006-12-22 06:09:51
anyway solved it by using jFrame thanks


any one has idea on how to make a certain JPanel focus in a container?
7  Game Development / Networking & Multiplayer / Re: Joining a new channel on: 2006-12-22 03:38:38
some mistakes makes by newbies..

haha

well i place my   '    dccChannel = channel;   '   in side the loop thats why it doesn't work.

   public void joinedChannel(ClientChannel channel) {

dccChannel = channel;
      if (channel.getName().equals(DCC_CHAN_NAME)) {
                  // previously it's here
               dccChannel.setListener(new ClientChannelListener() {
                public void playerJoined(byte[] playerID) {}
                public void playerLeft(byte[] playerID) {}
                public void dataArrived(byte[] from, ByteBuffer data,boolean reliable)
                {
8  Game Development / Networking & Multiplayer / Re: Joining a new channel on: 2006-12-21 03:12:29

it would really be nice if anyone out there help me with this thanks alot!

nevermind... solved
9  Game Development / Networking & Multiplayer / Joining a new channel on: 2006-12-19 04:21:44
when i called mgr.openChannel("Beer");

in the server side it did open a channel but the ID seems to be the same as the first one i create

how can i determine that i have created a channel "Beer"
10  Game Development / Newbie & Debugging Questions / Re: Any idea why my desktopPane doesn't show up? on: 2006-12-19 01:26:09
oh ok thanks for the reply as for the comments

i just want to spilt the comments bigger well for my own reference will be changing soon

and also for my teammate to find the codes

anyway thanks for your help and tips

i still can't get the destopPane to pop up , i am jus going to try out more ways
11  Game Development / Newbie & Debugging Questions / Any idea why my desktopPane doesn't show up? on: 2006-12-18 09:14:44
here's the code attached =)


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  
      //////////////////////////////////////
      // Panel for Tile Game Area
      //////////////////////////////////////
      JPanel gamearea = new JPanel();
      gamearea.add(game);
      gamearea.addMouseListener(new MouseAdapter() {
            public void mouseEntered(MouseEvent e) {
               game.requestFocus(true); // also try adding the param 'true'
            }
       });
      //////////////////////////////////////
      // Panel for UserList and Login Button
      //////////////////////////////////////
      JPanel userlistPane = new JPanel();
      userList = new JList(new DefaultListModel());
        userList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
        userList.addMouseListener(new MouseAdapter() {
            public void mouseClicked(MouseEvent evt) {
                if (evt.getClickCount() > 1) {
                    BYTEARRAY ba = (BYTEARRAY) userList.getSelectedValue();
                    if (ba != null) {
                        String message = JOptionPane.showInputDialog(
                                Login.this, "Enter private message:");
                        doDCCMessage(ba.data(), message);
                    }
                }
            }
        });
        userList.setCellRenderer(new ListCellRenderer() {
            JLabel text = new JLabel();
            public Component getListCellRendererComponent(JList arg0,
                    Object arg1, int arg2, boolean arg3, boolean arg4) {
                byte[] data = ((BYTEARRAY) arg1).data();
                text.setText(StringUtils.bytesToHex(data,0,data.length>4?4:data.length));
                return text;
            }
        });
        userlistPane.setLayout(new BorderLayout(1,2));
        userlistPane.add(new JScrollPane(userList));
        login.setSize(100, 200);
        userlistPane.add(login, BorderLayout.SOUTH);
      userlistPane.setBackground(Color.gray);
     
       
       
      //////////////////////////////////////
      // Main Panel for Adding other Panels
      //////////////////////////////////////
      //JPanel c = new JPanel();
      Container c = getContentPane();
        c.setLayout(new BoxLayout(c, BoxLayout.X_AXIS));
        //c.setLayout(new BorderLayout());
        c.setBackground(Color.gray);
        //desktop = new JDesktopPane();
        c.add(desktop, BorderLayout.CENTER);
        c.add(gamearea, BorderLayout.CENTER);
        c.add(userlistPane, BorderLayout.EAST);

        c.setSize(600, 400);
        //... Set window characteristics
        //setContentPane(c);
        //setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setTitle("Game");
        c.setVisible(true);
        pack();
12  Game Development / Networking & Multiplayer / Re: User ID on: 2006-12-14 05:53:13
thanks alot! =) Grin
13  Java Game APIs & Engines / Java 2D / Re: Collision on tilemaps on: 2006-12-14 05:40:38
i don't really understand i thought i have put the map in the array


in the if else i was trying to paint the image into the tiles is there another way?

i do not understand what you mean by not using the if else
14  Game Development / Networking & Multiplayer / Re: User ID on: 2006-12-13 02:28:35
hi , i can't see your file

u mind uploading again?
15  Game Development / Newbie & Debugging Questions / Re: Image buffereing? on: 2006-12-13 01:30:16
oh ok thanks alot! i'll try the array way =) thanks
16  Game Development / Newbie & Debugging Questions / Re: Image buffereing? on: 2006-12-12 03:00:35
It should never have problems with repaint. don't call repaint manually to 'fix' it, because there's something wrong, that causes the repaint not to occur automaticly. Better solve that! (try what i said in my previous post)

well thanks for your guide.

as for repaint() in my case i called an extra repaint

    public void paint(Graphics g) {
       super.paint(g);
       Graphics2D g2 = (Graphics2D)g;

        for(across = 0; across < width ; across++) {
            for(vert = 0; vert < height ; vert++) {
                if (A[vert][across] == 1)
                {

                    g2.drawImage(gras,across*32,vert*32,this);
                }
               
                else if(A[vert][across]==2)
                {
                    g2.drawImage(tree,across*32,vert*32,this);

                 }
               
                else if(A[vert][across]==3)
                {

                    g2.drawImage(mount,across*32,vert*32,this);

               }
               
                else if(A[vert][across]==4)
                {

                    g2.drawImage(seamount,across*32,vert*32,this);
                   
               }
               
                else if(A[vert][across]==5)
                {

                  g2.drawImage(sea,across*32,vert*32,this);   
                  
               }
               
                else if(A[vert][across]==6)
                {

                  g2.drawImage(sbr,across*32,vert*32,this);   
                  
               }
               
                else if(A[vert][across]==7)
                {

                  g2.drawImage(sbl,across*32,vert*32,this);   
                  
               }
               
                else if(A[vert][across]==8)
                {
                  
                  g2.drawImage(str,across*32,vert*32,this);   
                  
               }
               
                else if(A[vert][across]==9)
                {
                  
                  g2.drawImage(stl,across*32,vert*32,this);   
                  
               }
               
                else if(A[vert][across]==10)
                {
                  
                  g2.drawImage(shoretop,across*32,vert*32,this);   
                  
               }
               
                else if(A[vert][across]==11)
                {
                  
                  g2.drawImage(shoreleft,across*32,vert*32,this);   
                  
               }
               
                else if(A[vert][across]==12)
                {
                  
                  g2.drawImage(shorebottom,across*32,vert*32,this);   
                  
               }

                else
               {
                  
                  g2.drawImage(shoreright,across*32,vert*32,this);   
                  
               }
            }
        }

        g2.setColor(Color.cyan);
       g2.drawString(uname,x,y-10);
       g2.drawImage(pship, x, y,this);
       

       for(int i = 0;i< Login.q;i++)
       {
          //String nu = Login.nUser;
           g2.drawString(Login.nUser,xX,yY-10);
           g2.drawImage(pship, xX, yY, this);

       }
//as u can see, when i remove this repaint , i do not have that problem
not sure why but i seems that it's repainting a blank stuff.

repaint();
       
    }
17  Java Game APIs & Engines / Java 2D / Collision on tilemaps on: 2006-12-12 02:51:43
  i use the following to create the map

  int[][]  A  =  {       
            {5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5},    
             {5, 5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5},    
             {12, 12, 12, 12, 7,  5,  5,  5,  5,  5,  5,  5,  5,  5},    
             {1,  1,  1,  1,  11, 5,  5,  5,  5,  5,  4,  5,  5,  5},     
             {3,  1,  1,  1,  11, 5,  5,  5,  5,  5,  5,  5,  5,  5},
             {3,  1,  1,  1,  11, 5,  5,  5,  5,  5,  5,  5,  5,  5},    
             {1,  1,  1,  1,  11, 5,  5,  5,  5,  5,  5,  5,  5,  5},    
             {1,  1,  1,  1,  11, 5,  5,  5,  5,  6, 12, 12, 12,  12},
             {10, 10, 10, 10, 9,  5,  5,  5,  5, 13,  2,  2,  2,   2},    
             {5,  5,  5,  5, 5,  5,  5,  5,  5, 13,  2,  2,  3,   2},    
             {5,  5,  5,  5, 5,  5,  5,  5,  5, 13,  2,  2,  2,   2},
             {5,  5,  5,  5,  5, 5,  5,  5,  5, 13,  2,  3,  2,   2},    
             {5,  4,  5,  5,  5, 5,  5,  5,  5, 13,  2,  2,  2,   2},    
             {5, 5, 5, 5, 5, 5, 5, 5, 5, 8, 10, 10, 10,  10}
           
         };

        for(across = 0; across < width ; across++) {
            for(vert = 0; vert < height ; vert++) {
                if (A[vert][across] == 1)
                {

                    g2.drawImage(gras,across*32,vert*32,this);
                }
               
                else if(A[vert][across]==2)
                {
                    g2.drawImage(tree,across*32,vert*32,this);

                 }
               
                else if(A[vert][across]==3)
                {

                    g2.drawImage(mount,across*32,vert*32,this);

               }
               
                else if(A[vert][across]==4)
                {

                    g2.drawImage(seamount,across*32,vert*32,this);
                   
               }
               
                else if(A[vert][across]==5)
                {

                  g2.drawImage(sea,across*32,vert*32,this);   
                  
               }
               
                else if(A[vert][across]==6)
                {

                  g2.drawImage(sbr,across*32,vert*32,this);   
                  
               }
               
                else if(A[vert][across]==7)
                {

                  g2.drawImage(sbl,across*32,vert*32,this);   
                  
               }
               
                else if(A[vert][across]==8)
                {
                  
                  g2.drawImage(str,across*32,vert*32,this);   
                  
               }
               
                else if(A[vert][across]==9)
                {
                  
                  g2.drawImage(stl,across*32,vert*32,this);   
                  
               }
               
                else if(A[vert][across]==10)
                {
                  
                  g2.drawImage(shoretop,across*32,vert*32,this);   
                  
               }
               
                else if(A[vert][across]==11)
                {
                  
                  g2.drawImage(shoreleft,across*32,vert*32,this);   
                  
               }
               
                else if(A[vert][across]==12)
                {
                  
                  g2.drawImage(shorebottom,across*32,vert*32,this);   
                  
               }

                else
               {
                  
                  g2.drawImage(shoreright,across*32,vert*32,this);   
                  
               }
            }
        }



is there any way to set collision like J2ME?

             // Returns to the previous position if there is an obstacle      
           if (map.getCell(shipX, shipY) == 4 || map.getCell(shipX, shipY) == 6 ||
                   map.getCell(shipX, shipY) == 7 || map.getCell(shipX, shipY) == 8
                   || map.getCell(shipX, shipY) == 9 || map.getCell(shipX, shipY) == 10 ||
                   map.getCell(shipX, shipY) == 11 || map.getCell(shipX, shipY) == 12
                  || map.getCell(shipX, shipY) == 13 || map.getCell(shipX, shipY) == 14)
           {    
               shipX = preX;    
               shipY = preY;

like when it hits a certain location or a tile it will be stopped

from what i know j2me count by tile , mine is count by corrdinates

anyway to make a tile blocked?

thanks!
18  Game Development / Newbie & Debugging Questions / Re: Image buffereing? on: 2006-12-08 07:55:21
i have solve it , it's having problems with repaint() ;

thanks for your help i have also convert to BoxLayout =) no harm trying but useful =) Grin
19  Game Development / Newbie & Debugging Questions / Connecting J2SE application to servlet on: 2006-12-08 02:55:51
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  
        try{

//            establishing an URL connection with servlet
           DateServletURL = new URL("http://localhost:8080/IFCTech/servlet/huntServlet2");
           if( DateServletURL == null ){
              System.out.println("Server URL has not been set");
           }
           else
           {
              System.out.println("Server URL has been set");
           DateServletConnection = DateServletURL.openConnection();
           System.out.println("http://localhost:8080/IFCTech/servlet/huntServlet2");
//            inform connection that input and output will take place
           DateServletConnection.setDoInput(true);
           DateServletConnection.setDoOutput(true);

//            specify not to use cache
           DateServletConnection.setUseCaches(false);
           DateServletConnection.setDefaultUseCaches(false);

//            specify content type
           DateServletConnection.setRequestProperty("Content-Type","application/octet-stream");

           }
        }
           catch(Exception e)
           {
           e.printStackTrace();
           }





this part is where i need to connect to servlet it goes through the system.out.print

when i on tomcat it didn't call it
20  Game Development / Newbie & Debugging Questions / Re: Image buffereing? on: 2006-12-06 03:20:37
mmm still no difference
21  Game Development / Newbie & Debugging Questions / Re: Image buffereing? on: 2006-12-01 01:41:45
this is where i create my VD


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  
   public ValidatorDialog(Frame parent, Callback[] cbs) {
        super(parent, "Validation Information Required", true);
        callbacks = cbs;
        Container c = getContentPane();
        JPanel validationPanel = new JPanel();
        validationPanel.setLocation(200,200);
       
        validationPanel.setLayout(new GridLayout(2, 0));
        c.add(validationPanel, BorderLayout.NORTH);
        JButton validateButton = new JButton("CONTINUE");
        c.add(validateButton, BorderLayout.SOUTH);

        // when pressed, set the data from the UI components to the
        // matching CallBacks.
        validateButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                transcribeToCallbacks();
                ValidatorDialog.this.setVisible(false);
                ValidatorDialog.this.getParent().remove(ValidatorDialog.this);
            }
        });

        // Iterate through the javax.security.auth.callback.CallBacks
        // and render the appropriate UI accordingly.
        // For each CallBack, the matching UI Component is stored in
        // the dataFields array. The order is important, as they will
        // be retrieved along side their matching CallBack.
        for (Callback cb : cbs) {
            if (cb instanceof ChoiceCallback) {
                ChoiceCallback ccb = (ChoiceCallback) cb;
                validationPanel.add(new JLabel(ccb.getPrompt()));
                JComboBox combo = new JComboBox(ccb.getChoices());
                combo.setSelectedItem(ccb.getDefaultChoice());
                validationPanel.add(combo);
                dataFields.add(combo);
            } else if (cb instanceof ConfirmationCallback) {
                ConfirmationCallback ccb = (ConfirmationCallback) cb;
                validationPanel.add(new JLabel(ccb.getPrompt()));
                JComboBox combo = new JComboBox(ccb.getOptions());
                combo.setSelectedItem(ccb.getDefaultOption());
                validationPanel.add(combo);
                dataFields.add(combo);
            } else if (cb instanceof NameCallback) {
                NameCallback ncb = (NameCallback) cb;
                validationPanel.add(new JLabel(ncb.getPrompt()));
                JTextField nameField = new JTextField(ncb.getDefaultName());
                validationPanel.add(nameField);
                dataFields.add(nameField);
            } else if (cb instanceof PasswordCallback) {
                PasswordCallback ncb = (PasswordCallback) cb;
                validationPanel.add(new JLabel(ncb.getPrompt()));
                JPasswordField passwordField = new JPasswordField();
                validationPanel.add(passwordField);
                dataFields.add(passwordField);
            } else if (cb instanceof TextInputCallback) {
                TextInputCallback tcb = (TextInputCallback) cb;
                validationPanel.add(new JLabel(tcb.getPrompt()));
                JTextField textField = new JTextField(tcb.getDefaultText());
                validationPanel.add(textField);
                dataFields.add(textField);
            } else if (cb instanceof TextOutputCallback) {
                TextOutputCallback tcb = (TextOutputCallback) cb;
                validationPanel.add(new JLabel(tcb.getMessage()));

            }
        }
        pack();
        setVisible(true);
       
    }


----------------------------------------------------------------------------------------

and i call my VD in the class Login.java


1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
   public void validationRequest(Callback[] callbacks) {
      // TODO Auto-generated method stub
        status.setText("Status: Validating...");
        ValidatorDialog v = new ValidatorDialog(this, callbacks);
        v.setLocation(200, 200);
       
        game.setMsg(v.getUserName());
        //uname  = v.getUserName();
        mgr.sendValidationResponse(callbacks);
        v.pack();
   }
22  Game Development / Newbie & Debugging Questions / Re: Image buffereing? on: 2006-11-28 03:47:46
ok i will try it out thanks
23  Game Development / Newbie & Debugging Questions / Re: Image buffereing? on: 2006-11-24 01:47:37
i have a

public class ValidatorDialog extends JDialog

it pops up only when i need to log in but it's also having the problem

if you need any codes? i can paste it here not sure which codes do you all need to see

thanks for the expert advice

in the below picture

it has 2 label, 2 text field, 1 button

for the button and textfield need to click on it for it to appear

or drag the box larger the contents will appear



24  Game Development / Newbie & Debugging Questions / Re: Image buffereing? on: 2006-11-24 00:55:05
ok thanks alot i will try it out =) Cheesy
25  Game Development / Newbie & Debugging Questions / Image buffereing? on: 2006-11-23 01:47:25
hi i have this problem when other user sent message over it pop up a JOptionPane

and i can't see the content why this happens?

it happens when i paint more then 1

 g.drawImage



26  Game Development / Newbie & Debugging Questions / Re: J2ME lib on: 2006-11-02 02:43:45
oh ok thanks
27  Game Development / Newbie & Debugging Questions / J2ME lib on: 2006-11-01 02:09:47
hi was wondering while i was editing an application using eclipse , the lib files suddenly vanished? any idea?
28  Game Development / Networking & Multiplayer / Re: Help setting up elcipse for development on: 2006-10-30 00:42:04
oh right thanks!
29  Game Development / Networking & Multiplayer / Re: Help setting up elcipse for development on: 2006-10-26 03:42:05
hi i actually do not understand how to set up this paragraph

Create a new run configuration for the SGS. Enter your project as the project of the run configuration, and enter the class "com.sun.gi.SGS" as the main class (you have to check the checkbox "include libraries when searching for a main class" to choose this). Then go to the "arguments" tab and enter -I file:SGS-apps.conf under "program arguments".

thank you
Pages: [1]
 

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

The first screenshot will be displayed as a thumbnail.

Longarmx (35 views)
2014-10-17 03:59:02

Norakomi (25 views)
2014-10-16 15:22:06

Norakomi (24 views)
2014-10-16 15:20:20

lcass (26 views)
2014-10-15 16:18:58

TehJavaDev (50 views)
2014-10-14 00:39:48

TehJavaDev (50 views)
2014-10-14 00:35:47

TehJavaDev (40 views)
2014-10-14 00:32:37

BurntPizza (63 views)
2014-10-11 23:24:42

BurntPizza (36 views)
2014-10-11 23:10:45

BurntPizza (75 views)
2014-10-11 22:30:10
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
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!