Help on java game please

Hello, I have recenly finished my first draft of a 3d chess game that works pretty well, but i was interested in adding online multiplayer.
I was wondering if someone could give me ideas for efficient online communication and the names of classes i would have to use.
Also, i do not use the java 3d api but i made my own 3d class using the graphics2d class and was wondering if it would be benificial to use the 3d api.

mike72324 wrote:
Hello, I have recenly finished my first draft of a 3d chess game that works pretty well, but i was interested in adding online multiplayer.
I was wondering if someone could give me ideas for efficient online communication and the names of classes i would have to use.Look up Sockets and how they are used.
Also, i do not use the java 3d api but i made my own 3d class using the graphics2d class and was wondering if it would be benificial to use the 3d api.It is very difficult to tell, from what you have said you have a working game--so for communication purposes Java 3D is not going to do anything for you, but can it make what you have done easier? Difficult to say--Do you want to learn a new API to redo what you've already done? If so, load it and take a look. Generally speaking: Sun developed 3D so you wouldn't have to do your own conversions into 3D using their 2D API.

Similar Messages

  • Help with java games

    any ideas on dynomite-like games??
    where can i find online tutorials on how to make java games??

    honestly, it depends on your level! what can you program? can you use double-buffering? can you load and display images? i have a few classes i could supply you to help you make a game ( DoubleBufferedPane , SoundClip, MusicClip, Sprite, etc. ) owever i dunno where you are in leraning java...

  • Help with downloading games please

    Please can someone help me I have a blackberry playbook and I have tried to download games they do download onto play book but then when I go to play them I can't click on anything to play the game and all it says is delete please in easy to understant instructions tell me what I am doing wrong thanks

    Can anyone help me please as I dont know where to go to resolve this

  • Help with synching games please

    I have just purchased a game from itunes but when i pressed sync it said that I was 'not authorized on this computer'. What does this mean? Can anyone help? Many thanks.

    Can anyone help me please as I dont know where to go to resolve this

  • Help With Java Program Please!

    Greetings,
    I am trying to figure out to write a Java program that will read n lines of text from the keyboard until a blank line is read. And as it read each line, It's suppose to keep track of
    The longest string so far
    The Longest word seen so far
    The line that contains the most words
    The total number of words seen in all lines
    I don't know where to begin. Help me please! Thank you very much.

    Man I have to say that this smells like home work.
    Since you have not asked for a cut paste code I tell you what to do
    1. Write a function which take single string as a parameter and break it down to words and return words as a array or string
    (You can use this)
    you will need several variables to keep track of
    The longest string so far
    The Longest word seen so far
    The line that contains the most words and number of words in that line
    The total number of words seen in all lines
    now read lines in a loop if the length is 0 exit (that is your exis condition right)
    otherwise check the length of input string and update "The longest string so far"
    then break down the words and update "The Longest word seen so far", "The line that contains the most words and number of words in that line" and "The total number of words seen in all lines"
    and when you are exiting display the above values

  • Need help in java.security, please............

    I need to implement encryption in my java card.
    My sdk is v.2.2.1.
    At first, I just write a easy code and test adpu command in jcwde and it works well. (response 90)
    But every time when I trying to put
    desKey = (DESKey)KeyBuilder.buildKey (KeyBuilder.TYPE_DES,KeyBuilder.LENGTH_DES,false);"
    into procedure, the response becomes 6444, which means install error.
    Some people said in the forum that javacard.security only provide key interface, but is it the same in v2.2.1? If it is,then what's the function of KeyBuilder?
    Below is a part of my code.
    private SimCipher(byte[] bArray, short bOffset, byte bLength)
         desKey = (DESKey)KeyBuilder.buildKey (KeyBuilder.TYPE_DES,KeyBuilder.LENGTH_DES,false);
              register();

    Thank you for your reply. Actually, I was trying to implement AES in smart card, and I decide to write it myself. It is sucessed.
    Thank you again for your help.

  • Help with java. Please ASAP I have to submit this in a few HOURS

    I just downloaded the new java and I can't compile a test program that I need to complete for class. I was told to save a simple program in the "bin" folder and there isn't one in the "java6 update 2". When I try to compile the program is says "'javac' is not recognized as an internal or external command, operable program, or batch file."
    What do I do?

    if u use download jdk1.6.0
    go to bin folder to compile from command prompt..
    or u can use some compiler..
    u downloaded it but did u install??
    LOLL

  • Help for Connect4 game java.

    Hello, I am attending Java in the university, previously worked in C++, for my first work on java to me to make the Game of Connect 4 with GUI, navigating the forums i found a code for this game, well this code has a few problems, first the methods checkDiagonalFromTopLeft or checkDiagonalFromBottomLeft dosnt work, especial checkDiagonalFromBottomLeft, second when the 1st game is played and second game is coming the circle is yellow , taht to be RED NOT YELLOW well I NEED YOUR help guys please help mee
    the code please see heckDiagonalFromTopLeft checkDiagonalFromTopLeft
    especially heckDiagonalFromTopLeft
    import java.util.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Tallers1
         static class Connect4
              extends JPanel
              private static final int SIZE= 30;
              private static final int GAP= 10;
              private static final int ROWS= 6;
              private static final int COLS= 7;
              private Color mColor;
              private Color[][] mCounters;
              public Connect4()
                   reset();
                   addMouseListener(new MouseAdapter() {
                        public void mousePressed(MouseEvent e) {
                             hitTest(e.getPoint());
              private void hitTest(Point point) {
    int row = Math.min((point.y / (SIZE+GAP)*ROWS) / ROWS, ROWS-1);
    int col = Math.min((point.x / (SIZE+GAP)*COLS) / COLS, COLS-1);
                   if (mCounters[col][row] == null) {
                        for (row= ROWS-1; row >= 0; row--) {
                             if (mCounters[col][row] == null) {
                                  mCounters[col][row]= mColor;
                                  repaint();
                                  check(col, row);
                                  mColor= mColor == Color.RED ?
                                       Color.YELLOW : Color.RED;
                                  return;
              private void check(int col, int row)
                   if (checkVertical(col) ||
                        checkHorizontal(row) ||
                        checkDiagonalFromTopLeft(col, row) ||
                        checkDiagonalFromBottomLeft(col, row))
                        alert();
              private boolean checkDiagonalFromTopLeft(int col, int row)
                   if (col >= row) {
                        col= col-row;
                        row= 0;
                   else {
                        row= row-col;
                        col= 0;
                   for (int cnt= 0; row < ROWS && col < COLS; row++, col++) {
                        if (mCounters[col][row] == mColor) {
                             if (++cnt >= 4)
                                  return true;
                        else
                             cnt= 0;
                   return false;
              private boolean checkDiagonalFromBottomLeft(int col, int row) {
    if(row >= ROWS-1) {
    // do nowt and move on to the checking.
    else {
    int delta= Math.min(3, col);
    col= Math.max(0, col-delta);
    row= Math.min(ROWS-1, row+delta);
    for (int tally= 0; row >= 0 && col < COLS; row--, col++) {
    if (mCounters[col][row] == mColor) {
    if (++tally >= 4)
    return true;
    } else
    tally= 0;
    return false;
              private boolean checkVertical(int col)
                   for (int cnt= 0, row= 0; row < ROWS; row++) {
                        if (mCounters[col][row] == mColor) {
                             if (++cnt >= 4)
                                  return true;
                        else
                             cnt= 0;
                   return false;
              private boolean checkHorizontal(int row)
                   for (int cnt= 0, col= 0; col < COLS; col++) {
                        if (mCounters[col][row] == mColor) {
                             if (++cnt >= 4)
                                  return true;
                        else
                             cnt= 0;
                   return false;
              private void alert()
                   int option= JOptionPane.showConfirmDialog(this,
                        (mColor == Color.RED ? "Red" : "Yellow") +
                             " wins! Want to go again?",
                        "Game Over",
                        JOptionPane.YES_NO_OPTION);
                   if (option == JOptionPane.YES_OPTION)
                        reset();
                   else
                        System.exit(0);
              private void reset()
                   mCounters= new Color[COLS][ROWS];
                   mColor= Color.RED;
                   repaint();
              public void paint(Graphics g)
                   g.setColor(Color.BLUE);
                   g.fillRect(0, 0, getSize().width, getSize().height);
                   for (int col= 0; col< COLS; col++) {
                        for (int row= 0; row< ROWS; row++) {
                             g.setColor(mCounters[col][row] == null ?
                                  Color.WHITE : mCounters[col][row]);
                             g.fillOval(
                                  GAP+((GAP+SIZE)*col),
                                  GAP+((GAP+SIZE)*row),
                                  SIZE, SIZE);
              public Dimension getPreferredSize()
                   return new Dimension(
                        ((SIZE+GAP)*COLS) +GAP,
                        ((SIZE+GAP)*ROWS) +GAP);
         public static void main(String[] argv)
              JFrame frame= new JFrame();
              frame.getContentPane().add(new Connect4());
              frame.pack();
              frame.setResizable(false);
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.setVisible(true);
    }

    hi, 2) the GUI is from the forums the algorhytm is made by me, so i need to now wy the diagonal dostn Work ON GUI please, sorry my bad english i m from argentina
    import java.util.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Tallers1
    static class Connect4
    extends JPanel
    private static final int SIZE= 30;
    private static final int GAP= 10;
    private static final int ROWS= 6;
    private static final int COLS= 7;
    private Color mColor;
    private Color[][] mCounters;
    public Connect4()
    reset();
    addMouseListener(new MouseAdapter() {
    public void mousePressed(MouseEvent e) {
    hitTest(e.getPoint());
    private void hitTest(Point point) {
    int row = Math.min((point.y / (SIZE+GAP)*ROWS) / ROWS, ROWS-1);
    int col = Math.min((point.x / (SIZE+GAP)*COLS) / COLS, COLS-1);
    if (mCounters[col][row] == null) {
    for (row= ROWS-1; row >= 0; row--) {
    if (mCounters[col][row] == null) {
    mCounters[col][row]= mColor;
    repaint();
    check(col, row);
    mColor= mColor == Color.RED ?
    Color.YELLOW : Color.RED;
    return;
    private void check(int col, int row)
    if (checkVertical(col) ||
    checkHorizontal(row) ||
    checkDiagonalFromTopLeft(col, row) ||
    checkDiagonalFromBottomLeft(col, row))
    alert();
    private boolean checkDiagonalFromTopLeft(int col, int row)
    if (col >= row) {
    col= col-row;
    row= 0;
    else {
    row= row-col;
    col= 0;
    for (int cnt= 0; row < ROWS && col < COLS; row++, col++) {
    if (mCounters[col][row] == mColor) {
    if (++cnt >= 4)
    return true;
    else
    cnt= 0;
    return false;
    private boolean checkDiagonalFromBottomLeft(int col, int row) {
    if(row >= ROWS-1) {
    // do nowt and move on to the checking.
    else {
    int delta= Math.min(3, col);
    col= Math.max(0, col-delta);
    row= Math.min(ROWS-1, row+delta);
    for (int tally= 0; row >= 0 && col < COLS; row--, col++) {
    if (mCounters[col][row] == mColor) {
    if (++tally >= 4)
    return true;
    } else
    tally= 0;
    return false;
    private boolean checkVertical(int col)
    for (int cnt= 0, row= 0; row < ROWS; row++) {
    if (mCounters[col][row] == mColor) {
    if (++cnt >= 4)
    return true;
    else
    cnt= 0;
    return false;
    private boolean checkHorizontal(int row)
    for (int cnt= 0, col= 0; col < COLS; col++) {
    if (mCounters[col][row] == mColor) {
    if (++cnt >= 4)
    return true;
    else
    cnt= 0;
    return false;
    private void alert()
    int option= JOptionPane.showConfirmDialog(this,
    (mColor == Color.RED ? "Red" : "Yellow") +
    " wins! Want to go again?",
    "Game Over",
    JOptionPane.YES_NO_OPTION);
    if (option == JOptionPane.YES_OPTION)
    reset();
    else
    System.exit(0);
    private void reset()
    mCounters= new Color[COLS][ROWS];
    mColor= Color.RED;
    repaint();
    public void paint(Graphics g)
    g.setColor(Color.BLUE);
    g.fillRect(0, 0, getSize().width, getSize().height);
    for (int col= 0; col< COLS; col++) {
    for (int row= 0; row< ROWS; row++) {
    g.setColor(mCounters[col][row] == null ?
    Color.WHITE : mCounters[col][row]);
    g.fillOval(
    GAP+((GAP+SIZE)*col),
    GAP+((GAP+SIZE)*row),
    SIZE, SIZE);
    public Dimension getPreferredSize()
    return new Dimension(
    ((SIZE+GAP)*COLS) +GAP,
    ((SIZE+GAP)*ROWS) +GAP);
    public static void main(String[] argv)
    JFrame frame= new JFrame();
    frame.getContentPane().add(new Connect4());
    frame.pack();
    frame.setResizable(false);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setVisible(true);
    }

  • Displaying Picture in a Java APPLICATION please help!!

    I have been trying to write a method that Displays a .jpg file when called. However I have not gotten far, every book I have tell you how to display pictures in an applet but not an application. I did find some code that is supposed to be for an application, but It does not compile right. Any help would be apprecidated!
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class PictureIt{
    public void makeImage() {
    //***Image Output Stream
    String imgFile
    = "d:\\temp\\TestImage.jpeg";
    out = new FileOutputStream(imgFile);
    BufferedImage image = null;
    image = (BufferedImage)createImage
    (panelJpeg.size.width, panelJpeg.size.height);
    Graphics g = image.getGraphics();
    panelJpeg.paintAll(g);
    }

    Displaying Picture in a Java APPLICATION please help!!
    Hope this helps.There is going to be two classes compile seperatly first class is what does the drawing
    here it is
    import javax.swing.*;
    import java.awt.*;
    public class draww extends JPanel {
    Image ball;
    int width1 = 100;
    int height1 = 100;
    public draww() {
    super();
    Toolkit kit = Toolkit.getDefaultToolkit();
    ball = kit.getImage("pic1.gif");
    public void paintComponent(Graphics comp) {
    Graphics2D comp2D = (Graphics2D) comp;
    comp2D.drawImage(ball, 20, 20, width1, height1, this);
    sound class is the container JFrame here it is
    import javax.swing.*;
    import java.awt.*;
    public class drawing extends JFrame {
    public drawing() {
    super("draw");
    setSize(400,400);
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    Container pane = getContentPane();
    draww d = new draww();
    pane.add(d);
    setContentPane(pane);
    setVisible(true);
    public static void main(String[] args) {
    drawing drawing1 = new drawing();
    PS Hope this helps and see you around

  • How to program this in java? Please help

    How to program this in java?
    please explain steps, it has to come out like this:
    example
    input: 3b1w3b
    output:
    BBBWBBB

    import java.io.*;
    public class Test {
    static java.io.PrintStream o = java.lang.System.out;
    public static void main(String[] args)throws Exception {      
         BufferedReader BR = new BufferedReader(new InputStreamReader(System.in));
         System.out.print("Enter plot for printing: ");
         String s = BR.readLine();
         char[] cs = s.toLowerCase().toCharArray();
         for(int i=0, j=0; i < cs.length-0x1; i+=0x2, j=0)
              while(j++ < (int)(cs[i]-0x30))
                   o.print((char)(cs[i+0x1]-0x20));
    I tried changeing it to this so I can enter my own string, but I want to change it some more so that it can enter multiple input separated by space, so that it can form a sort of picture line by line. I tried using tolkenizer but I get errors. I dont know how to use tolkenizer properly can anyone please TEACH. you dont have to tell how or give me the code if you dont want to. yes I know Im a noob and I dont know java as good as everyone here, If everyone thinks I don't deserve help then DON'T help, I'm just trying to learn programming

  • When I play games in Mozilla on fb..some setting changed and now the pop up window that appears to send gifts to my friends only lists 3 ppl at a time some games i have a scroll down button others i dont..can u help m fix this please?

    When I play games in Mozilla on fb..some setting changed and now the pop up window that appears to send gifts to my friends only lists 3 ppl at a time some games i have a scroll down button others i dont..can u help m fix this please?

    Hi Winnie
    Unfortunately I have been sick and did not read the message before. I apologize.
    I have not received help beyond what is on the page. But when I get I tell you.
    I hope you can get answers. If you receive, I ask that you share with me.
    thank you very much
    best regards
    AC
    Date: Mon, 27 Feb 2012 09:33:10 -0700
    From: [email protected]
    To: [email protected]
    Subject: Pop up Window before saving remembering the need (forcing) to fill required fields in a form
        Re: Pop up Window before saving remembering the need (forcing) to fill required fields in a form
        created by Win_Form in Forms - View the full discussion
    Hi ACI wonder if you can share any responses on to your question above?I too have never used a script but, I have the same problems as you in regards to building a form. And wants to have the same 'protection' and message reminders for the end users. Any information, including a script and/or a contact email of experts you can share with me will help tremendously. Thank you so much in advance. Winnie
         Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/4232307#4232307
         To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/4232307#4232307. In the Actions box on the right, click the Stop Email Notifications link.
         Start a new discussion in Forms by email or at Adobe Forums
      For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • Problem with creating JAVA Source. please help

    Dear all
    how are you.
    In fact I have made a simple java class that return a string which represents the screen size . for example 800/600 or 1024/768 or others
    but I face error ORA-29541 class string.string could not be resolved
    This what i made
    first i created my JAVA Source
    CREATE OR REPLACE AND RESOLVE JAVA SOURCE NAMED "ScreenProperty" AS
    import java.lang.Object;
    import java.awt.*;
    public class ScreenProperty
    int w;
    int h;
    public static String getScreenSize()
    w = Toolkit.getDefaultToolkit().getScreenSize().width;
    h = Toolkit.getDefaultToolkit().getScreenSize().height;
    return w+"/"+h;
    SQL>Operation 160 succeeded.
    this means the the java source created successfuly
    and I'm sure that my java code is correct
    then i created a fuction to call this java source as fellow
    SQL> create or replace function f_get_screen_size
    return varchar2
    as language java
    name 'ScreenProperty.getScreenSize() return java.lang.String';
    Function created.
    the I Issued this sql statement to return the result that should be varchar2 that represent the sceen size(1024/768)
    SQL> select f_get_screen_size from dual;
    ORA-29541 class string.string could not be resolved.
    I do not know what is the reason for this error
    and when i searched the documentation for this error i found
    ORA-29541 class string.string could not be resolved
    Cause: An attempt was made to execute a method in a Java class that had not been previously and cannot now be compiled or resolved successfully.
    Action: Adjust the call or make the class resolvable
    I need to know what is the problem.
    And is there another way to load this class other than making JAVA SOURCE
    please help

    before drawing hands of clock you could fill a circle/oval with certain color, then you'd have that kind of circle that has been filled as backgound.
    you may change those dots to be small lines for 12, 3, 6 and 6 o'clock and then have small dots represent 1, 2, 4, 5, 7, 8, 10 and 11 o'clock
    anyhow, you should study that code and see how you can modify it whitout breaking it but having it look different.
    better yet would be trying to understand how it works, what any line there means and then recreate your own... this way you would learn more....
    and if there are some methods or anything you don't understand, then look them up from API documentation
    good luck.

  • How can I download java game?

    Hi everyone, sorry for my english, it is not my native language.
    I have Game.Jar file, which is java game for Nokia ,and I uploaded this file into database.
    Now I have a filed, type of byte[] (array of bites)
    next, I generate URL like http://site.com/getfile.xxx?id=10, and then user go to this URL via WAP, and trying to send him byte[] array with java game data.
    But I don't know which Content-Type i must send :(
    I trying to send Content-Type: application/jar , but after downloading game into mobile phone, the game doesnt open :(((
    please help me!

    excuse me, it's actually application/java-archive
    This works for me (PHP) but unfortunately you have to rename the downloaded file to .jar:
    <?php
    $file = fopen("MimeTest.jar","r");
    header("Content-Type: application/java-archive");
    $text = fread($file,filesize("MimeTest.jar"));
    print $text;
    fclose($file);
    ?>You can try it out here: http://woogley.net/misc/MimeTest.php
    Download that and rename it to .jar and see if the data stayed in tact..

  • OPEN SOURCE JAVA GAME

    Hi, my name is Dydra and I have been programming an MMORPG in java this last two years. I want to publish an open source Java game to start a new generation of cross platform games, but I can´t do it by myself xD. So I want to share what I have done so far with everyone interested in programming games so that everyone can help making this game.
    All the code is not mine: some parts are from the book Killer Programming Games. I adapted the 3D MMO engine of that book to an 2D engine and customized some things.
    If anyone can tell me how to make this an open project here at sun forums, please tell me xD.
    Here is a youtube link with the game working so far:
    http://www.youtube.com/watch?v=CvNtx_pibwM
    PM me or email me if interested: [email protected]

    Do you know the best part? It is almost finished. The things that need to be finished are:
    -Leveling up and stats (no big deal)
    -GUI (like menus and invetaries. no big deal too)
    -NPC (this may be the most complex part)
    - Shop and Players Party/Trade
    -Drops
    THE REST OF THE GAME IS DONE! I already did a map editor with custom map objects and will be used to place Non Agressive NPCs. I also made a custom set up of menues and skills. To have a skill or item into the game you just need to open your wordpad and write the img file and what the item does (damage, heal, equip, instant spell, etc).
    I need help to improve animation of the sprites, skills, improve the GUI ( I did it all myself but it's kinda crappy, you know) and the NPC. As I want it to be a PVP oriented game because there is no real RPG PVP oriented game. Most PVPs are MMOFPS like GunZ.
    I eben have the host for the server! jajajajaj
    Need your help guy!!!! Di you hear me!!!??? jajaja
    Thanks for responding, I hope you'll join my PvP cause xD

  • Firmware update on my Nokia E52 only run java game...

    Hi, I made that day Firmware update on my Nokia E52 and then update-s all right, only run java games and their sound is gone whether he shall be ON. Anybody have a similar problem and a solution for it?? Firmware-v 052.003 but the date is Cot. 29, 2010) will be happy if you give me an idea how to fix it! I tried quite moratoria preinstall, reset backup I have not done, unfortunately the old Firmware.

    Okay, you are using a MacBook so I am not sure how much help I can give since I use a PC with Vista. In the latest version of Ovi Suite, once the update file has been downloaded and the installation starts, the computer will give your prompts that the phone is disconnected via USB, the phone restarts, the screen flashes, etc. I just leave it alone and after the progress bar on the Ovi Suite ends my phone is updated. I currently have v40. The free maps is available only to v31 and above for 5800 if I remember correctly.
    If possible please use the Ovi Suite instead of PC suite (at least in my experience it works better), and do not in any way touch your phone during updates, even if it "disconnects" from the computer.
    However regarding to your query as to why it is not available via the *#0000# method (or FOTA), updates are generally released through NSU before FOTA, sometimes with as much as a month in difference because the files in FOTA are not the entire update file but rather extractions from it. For example, the v40 FOTA is 17mb (according to someone who said he had it already), while the v40 I downloaded through Ovi Suite was 128mb. 
    If you find my post helpful please click the green star on the left under the avatar. Thanks.

Maybe you are looking for