zachio / pong

Pong - Forever Alone Addition. This is an HTML5 game that is like pong except single player.
0 stars 0 forks source link

Possible touch control support #2

Open unknwnc opened 9 years ago

unknwnc commented 9 years ago

It would be cool if people on mobile devices could also play the game with touch controls.

zachio commented 9 years ago

I added you as a contributor in the README file.

zachio commented 9 years ago

I tried adding a different type of listener called window.onmousedown but I have not got it to work on my iphone yet. I need help with this one.

unknwnc commented 9 years ago

HTML5 has a separate set of events for touch: http://www.html5rocks.com/en/mobile/touch/

This is why I was thinking about managing input in the game engine- The engine could just give us a game.cursor object with everything about where the user is pointing, whether it's being controlled by mouse or touch. I want your input on this though; I've never tried or made a game engine, so I'm not sure what they typically do and don't do.

zachio commented 9 years ago

Yeah that sounds like a good idea. I tried to do that with Game.keyboard(keycode, callback) but I couldn't think of a way to do it. Can you help make it happen? I'm not sure how to do it. I'll take a look at the link. I can see what you mean with the Game.cursor being an object with mouse/touch info.

unknwnc commented 9 years ago

I just looked at your repository again, and it looks like you also committed... Is it still possible to merge?

I can work on the assets thing, and see if I can build it into the game engine. I believe GitHub has a way of assigning issues to people, so it's clear who's working on what, but I couldn't figure it out... Can you just assign the issue about assets to me?

unknwnc commented 9 years ago

Just a reminder; It's probably best to develop on a separate branch.

zachio commented 9 years ago

Committing to gh-pages branch was the only way I could test it on my iphone.

unknwnc commented 9 years ago

I see... Have you considered running a development server? I have a Ubuntu Server virtual machine in Virtualbox, so I can test sites with PHP, and of course test on mobile devices. Ubuntu server really is pretty easy to set up and install, and has very low system requirements.

unknwnc commented 9 years ago

Ah... Try this: https://koding.com/

zachio commented 9 years ago

I have godaddy servers i can upload to. But as far as testing something locally on my iphone I have no idea how to do that. By the way the mobile stuff is working now for the most part. It does need more work but at least you can play now on a mobile device. If you have any touch screen device feel free to try it.

unknwnc commented 9 years ago

You can develop on Koding itself. It gives you a nice text editor, and preinstalls server stuff. You can just install git, and start developing like usual. You can access the page it serves on your phone.

zachio commented 9 years ago

Is koding in the cloud where I can test it online with my iphone?

unknwnc commented 9 years ago

Yes. It gives you a virtual Ubuntu Server, online.

zachio commented 9 years ago

shoooot i just use github pages lol.