{"author_link":"\/users\/mrspeaker","author_name":"mrspeaker","author_uid":"mrspeaker","comments":[],"epoch":1544027904,"event":"LD43","format":"md","ldjam_node_id":136046,"likes":3,"metadata":{"p_key":"126316","p_author":"mrspeaker","p_authorkey":"1013726","p_urlkey":"342436","p_title":"Amazingly (and accidentally) my game works on mobile","p_cat":"LDJam ","p_event":"LD43","p_time":"1544027904","p_likes":"3","p_comments":"0","p_status":"WAYBACK","us_key":"1013726","us_name":"mrspeaker","us_username":"mrspeaker","event_start":"1543536000","event_key":"71","event_name":"LD 43"},"node":{"_collation":{"body_sanitizer":"TextUtils::SanitizeHTML via existing importer","event":"LD43","removed_author":false},"_superparent":120415,"_trust":4,"author":13726,"body":"I loaded up [my game](https:\/\/ldjam.com\/events\/ludum-dare\/43\/farm-to-table) on an iPhone, and was surprised to see it actually started running. I added some viewport meta tags and BOOM! it was actually playable!\n\n[![phone.png](\/\/\/raw\/e95\/3\/z\/1f17a.png)](https:\/\/ldjam.com\/events\/ludum-dare\/43\/farm-to-table)\n\nThere are a couple of reasons this is really amazing and crazy.\n\n## Hover? Laziness will fix that.\n\nThe first is, I never designed the controls to work with mobile: it was only a last minute design change at the zero hour (well, 2 hours before the zero hour) that meant it accidentally worked at all.\n\nInitially, stats in the game were to be editable at the top of the screen. You would click on someone\/something to see the stats at the top, then either click again to drag them, or move up and modify the stats. \n\nBut it was clunky and not fun. Also I had run out of time to make the stats meaningful. At the last minute I switched to the current (much more \"natural\") controls where you hover to see stats, then click to interact.\n\nThanks to some original code that **I forgot to delete**, both hover AND clicking would display the stats and select the entity. By accident, the lack of \"hover\" support on the mobile was solved. There's still a weird cursor on the screen that only kind of follows you around - but hey, it works!\n\n## `import Peep from \".\/Peep.js\"`.\n\nThe second reason I'm amazed the game works at all, is that I wrote it completely in JavaScript using all the latest-n-greatest EcmaScript features, without transpiling\/compiling anything... and the phone supports it all. Since when?!\n\nThat means that JavaScript native modules work on mobile devices. I had no idea it had rolled out so quickly. I don't know if the Android browser can run it yet (I'll test in the office today! [EDIT: Yep! Works on a recent Android device too!]), but I'm happy to see these features become ubiquitous.\n\n![ld43-proj.png](\/\/\/raw\/e95\/3\/z\/1f197.png)\n\nThe upside of these new features is that this image represents [my *entire* project](https:\/\/github.com\/mrspeaker\/ld43): no NPM project, no \"dot files\", no building... nuthin'. Just a few plain text files and we've got a game! View-source and you get all the code - just like the olden days again. *sniff*.\n\n[Play Farm to Table!](https:\/\/ldjam.com\/events\/ludum-dare\/43\/farm-to-table)\n\n","comments":0,"created":"2018-12-05T16:04:29Z","files":[],"files-timestamp":0,"id":136046,"love":3,"love-timestamp":"2018-12-05T17:49:26Z","meta":[],"modified":"2018-12-05T18:03:47Z","name":"Amazingly (and accidentally) my game works on mobile","node-timestamp":"2018-12-05T18:03:47Z","parent":132591,"parents":[1,5,9,120415,132591],"path":"\/events\/ludum-dare\/43\/farm-to-table\/amazingly-and-accidentally-my-game-works-on-mobile","published":"2018-12-05T16:38:24Z","scope":"public","slug":"amazingly-and-accidentally-my-game-works-on-mobile","subsubtype":"","subtype":"","type":"post","version":408059},"node_metadata":{"n_key":"136046","n_urlkey":"342436","n_parent":"132591","n_path":"\/events\/ludum-dare\/43\/farm-to-table\/amazingly-and-accidentally-my-game-works-on-mobile","n_slug":"amazingly-and-accidentally-my-ga","n_type":"post","n_subtype":"","n_subsubtype":"","n_author":"13726","n_created":"1544025869","n_modified":"1544033027","n_version":"408059","n_status":"WAYBACK"},"source_url":"https:\/\/ldjam.com\/events\/ludum-dare\/43\/farm-to-table\/amazingly-and-accidentally-my-game-works-on-mobile","text":"I loaded up [my game](https:\/\/ldjam.com\/events\/ludum-dare\/43\/farm-to-table) on an iPhone, and was surprised to see it actually started running. I added some viewport meta tags and BOOM! it was actually playable!\n\n[![phone.png](\/\/\/raw\/e95\/3\/z\/1f17a.png)](https:\/\/ldjam.com\/events\/ludum-dare\/43\/farm-to-table)\n\nThere are a couple of reasons this is really amazing and crazy.\n\n## Hover? Laziness will fix that.\n\nThe first is, I never designed the controls to work with mobile: it was only a last minute design change at the zero hour (well, 2 hours before the zero hour) that meant it accidentally worked at all.\n\nInitially, stats in the game were to be editable at the top of the screen. You would click on someone\/something to see the stats at the top, then either click again to drag them, or move up and modify the stats. \n\nBut it was clunky and not fun. Also I had run out of time to make the stats meaningful. At the last minute I switched to the current (much more \"natural\") controls where you hover to see stats, then click to interact.\n\nThanks to some original code that **I forgot to delete**, both hover AND clicking would display the stats and select the entity. By accident, the lack of \"hover\" support on the mobile was solved. There's still a weird cursor on the screen that only kind of follows you around - but hey, it works!\n\n## `import Peep from \".\/Peep.js\"`.\n\nThe second reason I'm amazed the game works at all, is that I wrote it completely in JavaScript using all the latest-n-greatest EcmaScript features, without transpiling\/compiling anything... and the phone supports it all. Since when?!\n\nThat means that JavaScript native modules work on mobile devices. I had no idea it had rolled out so quickly. I don't know if the Android browser can run it yet (I'll test in the office today! [EDIT: Yep! Works on a recent Android device too!]), but I'm happy to see these features become ubiquitous.\n\n![ld43-proj.png](\/\/\/raw\/e95\/3\/z\/1f197.png)\n\nThe upside of these new features is that this image represents [my *entire* project](https:\/\/github.com\/mrspeaker\/ld43): no NPM project, no \"dot files\", no building... nuthin'. Just a few plain text files and we've got a game! View-source and you get all the code - just like the olden days again. *sniff*.\n\n[Play Farm to Table!](https:\/\/ldjam.com\/events\/ludum-dare\/43\/farm-to-table)\n\n","title":"Amazingly (and accidentally) my game works on mobile","wayback_source":[]}