cute-turtle v1.0.0
🐢 Turtle style graphics for the web!!
Turtles!?
Yep, you heard that right! turtlejs
is a library that can bring your wildest turtle drawings/animations to life.
You can use this library to draw vector graphics. Some examples include fractals, L-systems, iterative patterns. Let your imagination go wilddd!!!
For more info on turtle graphics, visit https://en.wikipedia.org/wiki/Turtle_graphics
Installation
Using script tag
<script src="https://cdn.jsdelivr.net/gh/1ntEgr8/turtlejs/turtle.js"></script>
Using npm
npm install cute-turtle
Demos
Coming soon!
Usage
The library exposes the Turtle
class, which contains all of the functions you need to start drawing.
Start off by creating a turtle.
const turtle = new Turtle(0, 0, 1000, 1000);
The Turtle
constructor takes in an initial x-position, initial y-position, canvas height, and canvas width. The default values are 0, 0, 100, 100 respectively.
The canvas is where the drawing will appear.
Now that you've got a turtle, let's look at some of the things you can do with it.
Draw and Move
Turtle Info
Customization
Running the animation
Getting only the drawing, with no animation
Enjoy!
6 years ago