Game Database Connectivity Java
- by The Kraken
I'm developing a simple multi-player puzzle game in Java. Both players should be able to view the same game board on his own computer. Then, when one player makes an action in the game (ex. drags an object onto a coordinate space), the game's view should update automatically on the other computer's game screen. I'd like all this to happen over the internet, not requiring both computers to be on the same LAN connection.
If I need to use SQL/PHP to accomplish this, I'm unsure how to design the database to accomplish something as simple as the following:
Player A drags element onscreen
Game sends coordinates of element to database/server
Player B's computer detects a change to an item in the database
Player B's computer grabs the coordinates of Player A's item
Player B's machine draws onscreen elements at the received coordinates
Could somebody point me in the right direction?