Skip to content

Instantly share code, notes, and snippets.

@patricoferris
Last active February 23, 2018 19:35
Show Gist options
  • Save patricoferris/9b69646193794e7864042ce01673f796 to your computer and use it in GitHub Desktop.
Save patricoferris/9b69646193794e7864042ce01673f796 to your computer and use it in GitHub Desktop.
This is a simple setup of a p5 project - an index.html file to get the libraries and a JavaScript file to start creating
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.5.11/p5.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.5.11/addons/p5.dom.min.js"></script>
</head>
<body>
<script src="template.js"></script>
</body>
</html>
function setup(){
//Initialisation of canvas, objects, variables etc.
}
function draw(){
//The drawing loop - updates at a constant rate declared in setup
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment