开发者

Converting html5 canvas to android

开发者 https://www.devze.com 2023-03-08 02:47 出处:网络
I\'ve been spending the last week to develop a little platform game with HTML5\'s ca开发者_Python百科nvas element.

I've been spending the last week to develop a little platform game with HTML5's ca开发者_Python百科nvas element. I was thinking about trying to port my game to the Android platform, but came across a few questions. I have never done any Android programming, nor Java! Only Javascript and PHP - but belive I have a good understanding of programming in general.

  1. Will I be able to use the same procedure for building my game? Here I mean, my way of drawing everything on the screen/canvas. The rest is just calculations, and should be easily ported?

    • Every game loop I draw the background image, all items, and both players.
  2. What would be the best way to control a platform game on a touchscreen? I was thinking about detecting parts of the screen individually.

    • Finger on right side: Walk right
    • Finger on left side: Walk left
    • Tap screen: jump
    • 2 Finger tap: place bomb

Any suggestions or links are appreciated. Let me know if you need to see any code or an example of the game.


I suggest you look into using cocoonjs with your experience in php/javascript. It is really new so there is not a lot of documentation but if you pick through there demo code I am sure you will be fine.

http://wiki.ludei.com/cocoonjs:devguide


Am not being specific here but I think you can look up on Appcelerator Titanium and Phonegap to write Android apps using PHP and Javascript. There is a difference between how they function and what they do, though.

Here are some links:

http://www.appcelerator.com/products/titanium-mobile-application-development/ http://www.phonegap.com/home

0

精彩评论

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