Facebook
From Thijs E, 6 Years ago, written in JavaScript.
Embed
Download Paste or View Raw
Hits: 385
  1. class myClass{
  2.  
  3.         constructor(var1, var2, var3){
  4.                 this.var1
  5.                 this.var2
  6.                 this.var3
  7.         }
  8.  
  9.  
  10.         myMethod() {
  11.         fill(255, 255, 255);
  12.         ellipse(this.x, this.y, this.radius);
  13.     }
  14.  
  15.  
  16.     anotherMethod() {
  17.         if (mouseX < this.x + this.radius || mouseX > this.x - this.radius && mouseY < this.y + this.radius || mouseY > this.y - this.radius) {
  18.                 print("mouse is in");
  19.         }
  20.     }
  21. }
  22.  

Replies to Class prototype JS rss

Title Name Language When
Re: Class prototype JS Thijs E javascript 6 Years ago.