Skip to content

Instantly share code, notes, and snippets.

@indefinit
Created April 20, 2016 13:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save indefinit/b86a08cd28c81c53bb3d67ba3a698ebf to your computer and use it in GitHub Desktop.
Save indefinit/b86a08cd28c81c53bb3d67ba3a698ebf to your computer and use it in GitHub Desktop.
Sailboat.prototype = {
constructor: Sailboat,
sail : function(){
if(this.xpos > width)
{
this.xpos = -200;
this.ypos = random(height);
}
this.xpos = this.xpos + this.speed;
}
}; //<-- always remember semicolons
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment