Skip to content

Latest commit

 

History

History
13 lines (11 loc) · 1021 Bytes

README.md

File metadata and controls

13 lines (11 loc) · 1021 Bytes

img_pad

P5_pad

A simple pad for P5 projects. This pad can be useful in all cases where you have to choose directions of movement as in some games where you can not use the computer keyboard.
Place the P5_pad.js file in the script tag after the p5.js file.

<script src="p5.min.js"></script>
<script src="P5_pad.js"></script>

The use of P5_pad is very simple: in the skecth.js file you have to instantiate a Pad object and specify its position in the sketch and then use the four methods as in the following example:

code

Click on the pad's arrows to perform the associated function.
In this case the square moves in the four directions. This example