开发者

image manipulation in php or jquery?

For a learn-as-I-code game that I'm designing, I have a pretty rudimentary map:

http://www.dixieandtheninjas.net/dynasties/images/dynasties_map_2.jpg

I want to allow manipulation of the map in some of the following ways:

  • Have the code place a dot on the map where the player is located (sql query to determine region number)
  • Have the code recolor regions which are hostile to the player (sql query)

While I think that this question might be far too broad for a su开发者_Go百科ccinct answer here, I wonder if someone can point me in the right direction.

Is there functionality built into either PHP or jquery to do this? Will I need additional libraries or resources or anything?


I would recommend that you concider of doing more work on the client side, jquery can add the dots and so on to the map if you send the coordinates to the client.

You will of course have to validate the clients actions in order to prevent cheating.

Wrote a quick little sample of a jQuery script that adds dots to your map: http://jsfiddle.net/yc2MC/1/


well. this indeed is really broad topic and I would suggest starting with something more trivial e.g. tic-tac-toe game.

here are some pointers:
1) if you are about to have visual effects in browser, you would like to checkout canvas and svg (html5)
2) you should understand that any client side "actions" will be generated by javascript (could use jQuery and jQuery)
3) "backend would be php/mysql whatever other server-side-scripting language you choose.
4) communication most likely would happen using AJAX (.get, .post, .ajax)
5) if game is for iOS devices, you might want to read more about touch events

but, each of points above are very very broad. so I suggest that you make it clear for yourself as to what you want to learn and achieve first. then make a proper plan of what technologies are involved, and then get to coding.

good luck

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜