<commit_before>---
layout: post
title: "Let’s Make a 3D Game: Virtual Joystick"
date: 2011-12-24 12:21
comments: true
categories: 
---

Here is another article of the "Let's Make a 3D Game"
[series](/blog/categories/tutorial3dgame/).
We have already seen how to handle other inputs like
[keyboard](/blog/2011/09/12/lets-Make-a-3D-game-keyboard/)
and 
[device orientation](/blog/2011/09/20/lets-make-a-3D-game-device-orientation/).
This post is about [virtualjoystick.js](https://github.com/jeromeetienne/virtualjoystick.js)
It **virtual joystick**, another input you can use for your games.
A virtual joystick emulates a joystick behaviour on a touch screen.
[virtualjoystick.js](https://github.com/jeromeetienne/virtualjoystick.js)
has been coded in a effort to port
[marblesoccer](http://marblesoccer.com)
to mobile device.
Show, dont tell, 
[Try it out](http://jeromeetienne.github.com/virtualjoystick.js/).

* This
[demo](http://jeromeetienne.github.com/virtualjoystick.js/)
works with mouse events too thus, it is easier to test/debug.
* [virtualjoystick.js](https://github.com/jeromeetienne/virtualjoystick.js)
has been widely inpired by
[this post](http://sebleedelisle.com/2011/04/multi-touch-game-controller-in-javascripthtml5-for-ipad/)
by
[<NAME>](http://sebleedelisle.com/)
* The screencast below is short introduction about
[virtualjoystick.js](https://github.com/jeromeetienne/virtualjoystick.js)
  * go to the library page
  * give the topic
  * This is a screencast about virtualjoystick.js
  * This is a a javascript library which emulate a joystick on touch screen
  * This library done while porting marblesoccer to mobile devices
  * Game controller very usefull for mobile
  * it has been widely impired by this post from seb.ly
  * a cool guy, go look at creativejs. Many fun stuff to play with there.

  * explain what does it do ?
  * the demo works with mouse events too, it is usefull when you develop (or show screencast :). 
  * you press anywhere on the screen and then drag
  * you got the base and the stick
  * you land the base when you touch
  * you move the stick while dragging

  * you can see the coordinates here
  * possible to read it with ananolic coord
  * or more with a arrowkeys coords
  * pick the one that best fit your need.
<commit_msg>more work<commit_after>---
layout: post
title: "Let’s Make a 3D Game: Virtual Joystick"
date: 2011-12-24 12:21
comments: true
categories: 
---

Here is another article of the "Let's Make a 3D Game"
[series](/blog/categories/tutorial3dgame/).
We have already seen how to handle other inputs like
[keyboard](/blog/2011/09/12/lets-Make-a-3D-game-keyboard/)
and 
[device orientation](/blog/2011/09/20/lets-make-a-3D-game-device-orientation/).
This post is about [virtualjoystick.js](https://github.com/jeromeetienne/virtualjoystick.js)
It **virtual joystick**, another input you can use for your games.
A virtual joystick emulates a joystick behaviour on a touch screen.
[virtualjoystick.js](https://github.com/jeromeetienne/virtualjoystick.js)
has been coded in a effort to port
[marblesoccer](http://marblesoccer.com)
to mobile device.
Show, dont tell, 
[Try it out](http://jeromeetienne.github.com/virtualjoystick.js/).

* This
[demo](http://jeromeetienne.github.com/virtualjoystick.js/)
works with mouse events too thus, it is easier to test/debug.
* [virtualjoystick.js](https://github.com/jeromeetienne/virtualjoystick.js)
has been widely inpired by
[this post](http://sebleedelisle.com/2011/04/multi-touch-game-controller-in-javascripthtml5-for-ipad/)
by
[<NAME>](http://sebleedelisle.com/)
* The screencast below is short introduction about
[virtualjoystick.js](https://github.com/jeromeetienne/virtualjoystick.js)
  * go to the github page
  * give the topic
  * (move stuff on the screen while talking)
  * This is a screencast about virtualjoystick.js
  * This is a a javascript library which emulate a joystick on touch screen
  * This library done while porting marblesoccer to mobile devices
  * Game controller very usefull for mobile
  * it has been widely impired by this post from seb.ly
  * a cool guy, go look at creativejs. Many fun stuff to play with there.

  * so what does this library too do ?
  * lets play with the demo.
  * the demo works with mouse events too, a usefull feature when you develop (or shoot screencast :). 
  * you press anywhere on the screen and then drag
  * you got the base and the stick
  * you land the base when you touch
  * you move the stick while dragging

  * you can see the coordinates here
  * possible to read it with ananolic coord
  * or more with a arrowkeys coords
  * pick the one that best fit your need.

{'fraction_non_alphanumeric': 0.09645542427497315, 'fraction_numerical': 0.017185821697099892, 'mean_word_length': 4.122112211221122, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6542609', 'n_tokens_mistral': 1544, 'n_tokens_neox': 1424, 'n_words': 541}