Slither.io Play With Play Station 4 Controller, PS4 Control out now!

pscontroller

SLITHER.IO PLAY STATION 4 CONTROLLER

FEATURES:

  • Easily Play with ps4

Code

 (function () {
if (!("getGamepads" in navigator)) {
return;
}
var pollPad = function() {
var ps4 = navigator.getGamepads()[0];
if (ps4) {
var x = ps4.axes[0], y = ps4.axes[1];
if (Math.sqrt(x*x+y*y) < 0.1) x = y = 0; // deadzone radius
xm = 100 * x;
ym = 100 * y;
setAcceleration(ps4.buttons[0].value);
var b = mc.getContext("2d");
b.save();
b.beginPath();
b.strokeStyle = ps4.buttons[0].value ? "white" : "lightGreen";
b.arc(xm + mc.width/2, ym+mc.height/2, 8, 0, Math.PI * 2);
b.stroke();
b.restore();
}
window.requestAnimationFrame(pollPad);
};
pollPad();
})();

7 Responses to Slither.io Play With Play Station 4 Controller, PS4 Control out now!

  1. Stanford pines says:

    Dead radius line doesnt work, others good

  2. slither is awesome says:

    should i copy the code

  3. qwil says:

    what am i to do with this code?

Leave a Reply

Your email address will not be published. Required fields are marked *