• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

2player online game with java backend

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
I am planning a small game project but I'm not sure which way to do it.

My programming knowhow is limited, I feel most comfortable with Java. That's why I prefer it for the serverside.

The game itself:
2 players playing in browser, boardgame similar to chess (no artificial intelligence). What I basically need is to drag and drop pieces into squares (positions) and the gameserver should tell me if that move is allowed or not.

I played around a little with struts2 and struts2jquery. Is that a good approach? any recommendations to do it differently? HTML5 also has drag and drop but how would I call java methods from html tags?

I'd be thankful for some pointers

Cheers,
h.

 
Saloon Keeper
Posts: 15510
363
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Hasan, welcome to CodeRanch.

You could send an asynchronous request to the server using jQuery. The server can then interpret the request, do game checking and communicate with the opponent, etc. When the server is done, it can send a response in some format like JSON which is then read by the jQuery in your browser. I believe Spring MVC 3.0 can handle such requests and deal with JSON as well. It also has a nicer architecture than Struts2.
 
hasan atlasan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Stephan; so I'm more or less on the right track

I'll come back when I'm stuck
reply
    Bookmark Topic Watch Topic
  • New Topic