Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <head>
- <script src = "p5.js"></script>
- <script src ="p5.dom.js"></script>
- </head>
- <body>
- <script>
- //https://www.kadenze.com/courses/the-nature-of-code-ii/sessions/introduction-overview
- var x = 4;
- var w;
- var m;
- var xpos;
- var ypos;
- function setup(){
- createCanvas(400,400);
- w = new Walker();
- //m = new Move();
- }
- function draw(){
- background(255);
- w.display(xpos,ypos);
- }
- function Walker(){
- this.x = xpos;
- this.y = height/2;
- this.display = function(){
- //fill(255);
- noFill();
- ellipse(this.x,this.y,45,45);
- }
- }
- </script>
- </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement