Game program in JSP

Hi,
I wish to do a simple online poker game in java. Shall I write the code throgh socket programming? Is there any need to create a server through socket?(becuase I wish to implement this on a remote host). If I create a server, How will I run it remotely?Should I use the remote server instead of server program created by me?
I have experience in PHP programming. Also I have created simple chat programs run on My school's LAN. Shall I use remote Tomcat server for this purpose?
Shall I use servlet or JSP instead of socket programming.
Please help me.
Thanking in advance.
From,
Vinod A.

There is no definitive answer to this, it really depends on how you want the program to be used.
You could go for peer-to-peer just using sockets, but then you need to find a way of telling each client the IP addresses and port numbers of all the other clients. If you only want to play with a small number of friends on your schools LAN then this is OK.
Otherwise if your application will need to have a server component. This can a standalone program that runs on its own (using sockets), or a web application that's deployed inside an application server such as Tomcat (using Servlets & JSPs).
My advice to you would be to decide whether you want to offer a web based interface or not. Then start simple - write a version of the game that only supports two players.
Good Luck!

Similar Messages

  • I recently downloaded a 10.6.8 update and a game program has now been reduced in size.  It's specifications are set for full screen, but it is about 1/4 of the size.  Any ideas how to fix?

    I recently downloaded a 10.6.8 update and a game program has now been reduced in size.  It's specifications are set for full screen, but it is about 1/4 of the size.  Any ideas how to fix?

    Hi, I have got the same problem but all is 1/4 the size have you fixed it?

  • How to include the javafx program in JSP page

    I am working on a college project and i have got a problem that how will I can use the javafx program in JSP.
    plz imform me as soon as possible

    The JavaFX app can be included in JSP as an Applet.

  • How to call stand Alone java program from jsp

    Hello all...
    I want to use the stand alone java program in jsp page. I compiled the java program and place the class file in classes folder under web-inf. But when i try to instantiate the java class inside jsp it is not recognizing the class. Where might be the problem
    Plz help....
    Shamim

    hi , this is dheeraj.. i need to know that how to execute java code and class in jsp.. if anyone know about if bt tell me.. i just know that we can use java code by java beans in jsp.. if you know any knowledge regarding this topic please send me.....

  • Applet Game Programming - player movement

    HI Java Experts,
    I have a very simple question applet game programming - jdk 1.02.
    Let's say you have a player on the applet window. He can move right and left.
    Naturally you have an image representing the player. When the player moves left you present an image loop with him running left. And vice versa for running right.
    Of course when he stops moving you just want to show a still image.
    What do you guys feel is the best technique for that situation ?
    Stephen

    Hi Thanks for the advice.
    I'm under the impression that if I used jdk1.4
    everybody who wanted to play the game would have to go
    through the trouble of downloading something . If
    that is so, then i would like to stick with 1.02 to
    have the widest possible audience.Use Java Web Start to deploy it as an application instead of an Applet. If your program is really cool, people will download the JDK 1.4 to use it. Then we will have more java users in the world :)
    By the way i have a URL perhaps someone could look > at the source code and give additional suggestions
    you can make sonic the hedge hog run and jump
    http://www.swebdev.com/Adventure.html
    That code has some good points. I like the nice object oriented flow of it. However, the way he sets up the Thread is all wrong. He uses yield and sleep, you would want to set up this using wait() and notifyAll() calls if you want to make it more interesting.
    Right now i'm trying to address the issue of how to
    reverse the image for when the player is running the
    opposite way -- ? perhaps a separate thread in 1.02
    might be an answer? I would be glad to hear all kinds
    of suggestions on the sample code seen thereYou shouldn't need a separate thread just to reverse the image. If your little guy is already in his own thread, just switch the image that is displayed when the player hits the opposite direction key.
    Think of threads like puppets, and you are the puppet master. Your little guys is a puppet, so he should be in his own thread. You can make him do whatever you want from your thread (the master) by pulling strings (changing globals, and message passing)
    Wow... Thats a really good analogy... I just thought that up :)

  • Timer for game program.

    Hello all,
    I am making a game program and I need a way to implement a timer so that it the game will end if the time expires.
    Is there any easy function to help me with this task?

    Thanks for the reply and I just found that class.
    Thanks

  • J2ME game programming

    Helo everyone,
    I am working in j2me game programming plz if
    any one know how make image as small as possible
    in our game program.?
    I am using *.png format of image which is working well
    in game but my game size is very big so plz help me to get
    out of this problem
    Thank u
    Aman Gautam

    hi,
    if you want to do any kind of game programming in J2ME, i suppose you would require to use the Canvas class, well there are a few good resources.. try out
    www.billday.com
    www.javamobiles.com..
    that ought to get u started.
    cheerz
    ynkrish

  • J2Me game programming plz help

    Helo everyone,
    I am working in j2me game programming plz if
    any one know how make image as small as possible
    in our game program.?
    I am using *.png format of image which is working well
    in game but my game size is very big so plz help me to get
    out of this problem
    Thank u
    Aman Gautam

    I solved the same problem by using indexed color images instead of true color.
    So, for example, if you have a colorful background you can convert it to a 256 color image.
    Depending on your specific image and the devices you'll see it on you may or may not notice the difference, but the file size is generally smaller.
    Then you can push further for smaller elements, like, say, a moving object like a pointer or a starship, you can reduce it to 60 or 30 colors, or even less.
    Another technique is to use tiles to build up the background instead of big images. With MIDP2.0 there's the TiledLayer, but you can implement the same with some code also on MIDP1.0 if backward compatibility is of concern.

  • Can we run external mail program from JSP / Servlet deployed on tomcat

    Hi folks,
    Had a tough time getting JavaMail API to work, finally when things seem to be working
    there were some issues with the vendor's server, so finally gave up the idea.
    On the server Apache and Tomcat are integrated via mod_jk and currently I redirect to a php page
    which acts as a helper to send mail, however for the given business needs and server's limitations
    there are potential security holes.
    So I was wondering if I could directly execute the linux sendmail program from JSP/Servlet
    as we would in a standalone java program or do we need special settings on Tomcat to execute external
    programs.
    Please let me know your views / ideas / comments on this
    Thanks in advance
    Abishek

    Hi
    It's not designed for you to be able to do this, it needs to run through 10gAS or 11gWeblogic.
    Tony

  • I want to learn 2D game programming. But, I am confused!

    I want to make a 2D game in C#. I have begun learning C# on my own. But, I am confused sbout what to learn after c# to make a game. I hear many things like XNA, MDX, Monogame, SlimDX, SharpDX, Frameworks, game engines, IDE's etc. To me all of this has
    caused a great confusion. The C# game tutorial I am learning is based on MDX (Managed DirectX). Now, I realise that MDX and XNA is dead. I am confused if I want to change my tutorial itself. Can anyone clear things out for me and tell what i need to learn
    step by step?
    I really don't even know what all the sh*t (.NET ,XNA, Monogame, SharpDX, xxx, xxxx, xxxx etc.) really is or what it does or which is better or even what the differences are. So please explain everything to me. Please help!

    Hi,
    You can refer to the Books:
    Beginning .NET Game Programming
    Beginning C# Game Programming
    Few other useful links:
    Coding 4 Fun is a great .NET resource that has quite a few user-created games. They also have a
    book and a
    2-D game primer
    Tutorial Listing at C# corner
    C# Game Tutorial for Beginners (video)
    Link to more game programming e-books
    Advanced Topics
    The Farseer Physics Engine on Codeplex would be a good next step once you get comfortable with programming games.
    Please mark as answer or vote as helpful if my reply does

  • About game programming.. please....help

    How to define game map for java midlet
         If I see the rpg game, it have default map. I want to know how to translate it to code
         in midlet? The map will be existed image or dynamicly generated?
         Like Prince of Persia Midlet version, I wonder how to generate the environment?
         Is it pixel generated or immutable image?
    detect collision
         SO if the map is image and the sprite game is draw over the map, how can we detect the
         collision?
         Please hellp me.... because I want to be game programmer for midlet but I
         didn't know about game programming before

    to write a small game in midl is already a hard work. to make a big one, take a look of a team of programers.
    about maping, there is no such thing. wire every thing by yourself. by books or read tutorials.
    as i already said. no easy task.
    but keep on trying. if you need some help write me a mail.
    [email protected]
    jeliel
    (sebastian)

  • Mobile Game Programming

    Hey All,
    I am a decent Java programmer but in last few days I found Java Game Programming intresting and has strong future for ones career.
    I wanted to know what do Expert over here have to say about this ?
    and
    Where do I need to start In order to get to know about it ?(I mean under Java).
    Thanx
    Messy

    I suggest you move to this forum and ask your question again.
    http://forum.java.sun.com/category.jspa?categoryID=23

  • Game program - simon sez

    I have a simple game program call simon sez. I have the code completely
    written, but i cant figure out why its not working. I have the area
    in the program that is not working right and have add ********* where
    the problem area is. Can anyone figure out what ive done wrong here???
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;
    import java.lang.*;
    import sun.audio.*; //import the sun.audio package
    import java.io.*;
    public class SimonMain extends Applet implements ActionListener {
    SimonButton[] simonb = new SimonButton[4];
    SimonButton[] navb = new SimonButton[2];
    SimonButton gob = new SimonButton("GO");
    Label level;
    int levelc;
    int[] levelarray = new int[10];
    int playmode = 1;
    int arraycount=0;
    int whichbutton=0;
    AudioClip snd1;
    AudioClip snd2;
    AudioClip snd3;
    AudioClip snd4;
    AudioClip right;
    AudioClip wrong;
         //Initialize the applet
    public void init() {
    levelc=1;
    snd4=getAudioClip(getDocumentBase(), "three.wav");
    snd3=getAudioClip(getDocumentBase(), "two.wav");
    snd2=getAudioClip(getDocumentBase(), "one.wav");
    snd1=getAudioClip(getDocumentBase(), "zero.wav");
    right=getAudioClip(getDocumentBase(), "right.wav");
    wrong=getAudioClip(getDocumentBase(), "wrong.wav");
    level = new Label("Choose Level: "+Integer.toString(levelc) );
    add(level);
    for(int count=0; count<4;count++)
    simonb[count] = new SimonButton(Integer.toString(count));
    simonb[count].ColorButton(Color.black );
    simonb[count].ColorFont(Color.white);
    simonb[count].addActionListener(this);
    add(simonb[count]);
    for(int count=0; count<2;count++)
    if(count==0)
    navb[count] = new SimonButton("<");
    if(count==1)
    navb[count] = new SimonButton(">");
    navb[count].addActionListener(this);
    add(navb[count]);
    gob.addActionListener(this) ;
    add(gob);
    public void paint(Graphics g) {
    g.drawString ("Simon Sez: Choose your level using arrow buttons and click go to play.Have FUN!!!",10,50);
    public void actionPerformed(ActionEvent event) {
    //test.setText("Button number is " + buttonCaption);
    String command = event.getActionCommand();
         //if (command.equals("Push")){
    if (command == "GO")
    playmode=3;
    switch(playmode)
    case 1: //This is choose level mode
    if (command == "<" )
    if(levelc==1);
    else
    levelc--;
    level.setText("Level: "+Integer.toString(levelc) );
    if (command == ">" )
    if(levelc==10);
    else
    levelc++;
    level.setText("Level: "+Integer.toString(levelc) ) ;
    break;
    case 2: //This is play mode
    //This is where it wont get past my if statement???????????????????????????
    if ( "0"==command)
         {     level.setText("WORKIng"+command);
    simonb[0].ColorFont(Color.red);
    for(int count=0;count<100000000;count++)
              snd1.play();
    simonb[0].ColorFont(Color.white );
    whichbutton=1;
    if((levelarray[arraycount]==whichbutton))
    if(arraycount+1==levelc)
    { right.play();
    playmode=1;
    break;
    arraycount++;
    else
    {   wrong.play();
    arraycount=0;
    if ("1" == command)
    simonb[1].ColorFont(Color.yellow);
    for(int count=0;count<100000000;count++)
              snd2.play();
    simonb[1].ColorFont(Color.white );
    whichbutton=2;
    if((levelarray[arraycount]==whichbutton))
    if(arraycount+1==levelc)
    { right.play();
    playmode=1;
    break;
    arraycount++;
    else
    {   wrong.play();
    arraycount=0;
    if (command == "2" )
    simonb[2].ColorFont(Color.blue);
    for(int count=0;count<100000000;count++)
              snd3.play();
    simonb[2].ColorFont(Color.white );
    whichbutton=3;
    if((levelarray[arraycount]==whichbutton))
    if(arraycount+1==levelc)
    { right.play();
    playmode=1;
    break;
    arraycount++;
    else
    {   wrong.play();
    arraycount=0;
    if (command == "3" )
    simonb[3].ColorFont(Color.pink);
    for(int count=0;count<100000000;count++)
              snd4.play();
    simonb[3].ColorFont(Color.white );
    whichbutton=4;
    if((levelarray[arraycount]==whichbutton))
    if(arraycount+1==levelc)
    { right.play();
    playmode=1;
    break;
    arraycount++;
    else
    {   wrong.play();
    arraycount=0;
    level.setText(command ) ;
    break;
    case 3: //This is generate mode
    arraycount=0;
    whichbutton=0;
    playmode=2;
    for(int count=0;count<levelc;count++)
    levelarray[count]=1+ (int) (Math.random() *4);
    level.setText(Integer.toString(levelarray[count]) );
    for(int count=0;count<levelc;count++)
    if(levelarray[count]==1)
    simonb[0].ColorFont(Color.red);
    for(int countr=0;countr<100000000;countr++)
              snd1.play();
    simonb[0].ColorFont(Color.white );
    if(levelarray[count]==2)
    simonb[1].ColorFont(Color.yellow);
    for(int county=0;county<100000000;county++)
    snd2.play();
    simonb[1].ColorFont(Color.white );
    if(levelarray[count]==3)
    simonb[2].ColorFont(Color.blue);
    for(int countb=0;countb<100000000;countb++)
              snd3.play();
    simonb[2].ColorFont(Color.white );
    if(levelarray[count]==4)
    simonb[3].ColorFont(Color.pink);
    for(int countp=0;countp<100000000;countp++)
              snd4.play();
    simonb[3].ColorFont(Color.white );
    playmode=2;
    } //end of for loop
    playmode=2;
    break;
         //Get Applet information
    public String getAppletInfo() {
              return "Applet Information";
         //Get parameter info
    public String[][] getParameterInfo() {
              return null;
    import java.awt.*;
    import java.awt.event.*;
    public class SimonButton extends Button implements ActionListener{
    public SimonButton(String label) {
    this.setLabel(label) ;
    public void actionPerformed(ActionEvent event) {
    public void ColorButton(Color color){
    this.setBackground(color);
    public void ColorFont(Color color) {
    this.setForeground(color );
    public void paint(Graphics g) {

    you need to replace all occurrances in your code of:
    if(".." == command)....
    with:
    if("..".equalsIngnoreCase(command))...
    When doing string comparison, the equality operator doesn't work. Use the provided method instead

  • Multiplayer game programming - Code of a basic server

    I'm a beginner in multiplayer game programming and I'm looking for the code of a basic server for a multiplayer game. I don't mind which kind of game (I mean: chess, ping-pong, battlenet...) The important thing is the code pattern abnd the server structure.
    Could anyone help me?

    If you want to have a look at a generic multi-threaded server, check out the Java networking tutorial.. there's a basic example server that responds to a "Knock knock, who's there?" conversation.. you can start off with it..
    Of course it's not a game server but you could try sticking in a game engine to maintain the game world and change the user sessions to a proper game protocol.. e.g. sending key strokes or joystick movements. You could also get the server to send player and enemy positions etc...
    Good luck!

  • TS1702 I have installed a game program on both my I phone and I pod mini....I want to remove it on both items how to I do this????

    How to removed a game program from both my Iphone and Ipad mini??

    Tap and hold any app icon until they all wiggle.  Press the black x to delete the app.  Press the home button when done.
    Note that when they are wiggling, you can drag then around to position as desired.
    http://manuals.info.apple.com/en_US/iphone_user_guide.pdf

Maybe you are looking for

  • HTTP adapter: where to see the transformed output message

    All, I am a beginner in Webservices/HTTP interfaces in PI. I have to make changes on an existing custom interface which uses HTTP adapter. I have done the changes in the message mapping and tested it using the test tool. It seems OK. However when we

  • Bin Packing Problem

    Hello all, Can you please help me out a little bit on bin packing problem? I have a jpanel and i want to divide its space in order to put rectangles but having in mind that i have to take advantage of all the empty space provided by the jpanel thnx,

  • How can I change how email "from" and "to" are being handled by Groupware?

    When a follow-up business activity (e.g. sales visit) is created in CRM and assigned to another by the "person responsible" field, it triggers the following action in Outlook: u2022 Outlook recognizes that "created by" and "person responsible" are di

  • Performace of httpservice

    I have recently written a flex app that downloads some xml data from a URL using HTTPService to call a php script and return xml. This works fine as it is a v. simple app, but what if there were many requests to this URL. A friend told me to use amfp

  • Why do some headphones not work in my iPod 4th gen.?

    I got new earbuds for Christmas but when I put them in my iPod it sounds weird. It like remove the vocals and it plays them in the background really soft and the bass plays really loud over them. Other headphones work fine in my iPod and these work f