How do I make a network game on JAVA?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • LazyPrinzez
    New Member
    • Jan 2010
    • 13

    #1

    How do I make a network game on JAVA?

    There is a local card game here in our place that me and my classmates got addicted to (oh no, we don't put bets on it, we just play the game), but when we get to our respective homes, no one in our place knows how to play the game but us. So we were thinking if we could search the net for an online version, but no, there is none (because it's a local game, no one out there knew of it).

    Now we thought like, "What if we make this game into an internet program?"

    It's a nice thing to say, but unfortunately, the game needs different people playing it, so we obviously need to make this program work like a network--that's the problem. None of us second year Computer Science majors know how to make a network game, because we just turned second years last June (I know this is just an excuse but you get the point--we are the neophytes in this CS community). Needless to say, we don't have any knowledge about network-based programs.

    So please kindly help me with this question. Not only will we be able to make the game online, we would also definitely acquire knowledge about making network-based programs. =D

    PS: We would like to put it up on the net somewhere so we can access it anytime. The game rules are really easy so if we finish this little project, we would also like you to try it.... ^_^
  • chaarmann
    Recognized Expert Contributor
    • Nov 2007
    • 785

    #2
    1.) Rent a server with Apache-Tomcat running (no database needed, no big disk space needed). You should get one for around 5$ per month.
    2.) Program an HTML-Page that shows up the cards in your browser and where you can make some action with the cards (e.g. draw, show, flip etc. Javascript can help you manipulating and moving the images) Send this action to the Apache-Tomcat server (Ajax can help you, but is not necessary. A simple Submit-button will do for the beginning).
    3.) Program the server in Java (JSP) that takes the action, computes the result (e.g. resulting cards or points) and sends these results to the browser as a new HTML-page.(Or Ajax-data which will be changing the current page then).

    Basically, there is only one program running as gameserver on the rented host, and everybody can send their moves to this single program by his own browser, running on different PCs. (If you need groups of people playing different games in parallel, then you need to create playrooms, logins, parallel threads, synchronization s, restore-points etc. which is ways more complicated, so start with the easy stuff)

    Comment

    Working...