Moving Objects on top of an image

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
PoulMM
Forum Newbie
Posts: 2
Joined: Sat Sep 12, 2009 2:56 pm

Moving Objects on top of an image

Post by PoulMM »

Hi there.

I have a board game I am hoping to convert to a PHP based browser game. For this purpose I need the PHP script to be able to move objects (counters) on top of an image/background. When players make a move the counters will be moved to a new position. I have a script that gives the user details of XY coordinates, but it doesn't display objects.

It can be done with Java, but is it posible with PHP? I am not looking for finished code but for ideas and hopefully links to sites where I can read how to do it. I searched this forum but couldn't find threads dealing with this.

Thanks in advance.

Poul
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Moving Objects on top of an image

Post by requinix »

PHP is server-side. It is not used to move objects on a board, or tell where they've been moved to. That's what you'd use JavaScript and AJAX for.

- PHP generates the page with the board and initial piece placement
- JavaScript is used to let the user move the pieces around
- AJAX sends a message to PHP telling which piece moved where
PoulMM
Forum Newbie
Posts: 2
Joined: Sat Sep 12, 2009 2:56 pm

Re: Moving Objects on top of an image

Post by PoulMM »

Okay, thanks a lot. That makes sense...
Post Reply