⭐️ In this tutorial we will learn to draw simple shapes and colors~
bear tweetcart by zep.p8 (@URL)
Hello Circle
Pico-8 has a special function _draw
that executes over and over
Let’s try to draw a circle using this function
The screen is 128x128 pixels and the X and Y values flow right and down.
To pick a color use a number.
Move things around!
There is another special function _init
that is executes once at the start.
Let’s define a variable x
there and then make x
bigger every time in draw to move the circle.
We can use an if
statment to teleport the circle back to start of the screen
Draw with loops
A for
loop allows you to iterate a variables value from one number to another
Exercise 🍓
Can you recreate this using clr
, if
, for
and shape functions?
You can refer to the Cheatsheet to find code for shapes.
And this
Draw with random
The function rnd(n)
will return a random number between 0 and n.
Exercise 🍓
Try drawing something fun with random!
Draw for fun
Now just play with what you’ve learned to draw whatever you feel like!
Don’t forget to refer to the Cheatsheet if you need. These are the basic shapes and their functions:
Next
⭐️ 4. Animating with Sin & Cos
Appendix
Tips
- You can capture screenshots with
ctrl-6
and gifs withctrl-8
thenctrl-9
. You will see an image popup on the top right that you can right click and save.
Credit
- The red circle examples and animations were taken from # Intro to Pico-8 Programming