Tuesday, December 30, 2014

Work in Progress ( add button and control)

After getting the circle as the prototype . I start to test how to move the object to move in different direction. because of using mobile as controller i cannot use keycode to control the object i need to use button to send data to server. when the server received the data then the object with base on the code.

Below is how i key in the button, when on click it will trigger the javascript and send a code to the server.


Below is the javascript to send data to the server, when the button left is being trigger it will send "a" to the server.


Below is the javascript on the received end of the code which is also the display html, which mean when the code "a" had be received this code will trigger and the function left will be trigger.

When the function left be trigger, the object x will -2; same go to different direction.

Below is a video example to show how it work.



I used firebug to check the data that being send and received after trigger the button.

to download go to the link below:
http://getfirebug.com/releases/lite/chrome/


References

Getfirebug.com,. 'Firebug Lite For Google Chrome : Firebug'.  [online] Available at:http://getfirebug.com/releases/lite/chrome/[Accessed 23 Dec. 2014].

No comments:

Post a Comment