Learn to Code via Tutorials on Repl.it!

← Back to all posts
Crazy SQUARE CLICKER Tutorial [PythonTurtle]
plscodeinjava

This is a tutorial made for my 121 cycle special....

Hello everyone! Today I am teaching you how to make a square clicker in turtle... I don't know WHY you would EVER want to use this, but anyway....
First, you are going to want to do the imports. I am using the shapely module to test for boundaries:

Now, we are going to want to set up our variables:

The next step is to declare the array for the squares:
squares = []
Next, we will have to make a huge for loop to draw all the squares:

Now, it's time for the confusing part. The shapely polygon module takes a set of points as the corners of the polygon. We will want to record these points:

Now, we will actually draw the square:

After we draw a square, we will want to set up for the next one:

Ok, so now, we will want to create a square out of our points and append it to the squares array:

And after we draw a row of squares, we will want to move down a row:

Ok, here is the entire point of this tutorial. I have made a squareCheck function which can be binded to onclick:

Now, the only other thing to do is bind this to onclick and run the program:

I really hope you enjoyed this tutorial and it helps you with your projects! Oh, and here is the full code:

Note: in the project I have attached there is some commented out lines. You do not need to put these in your code.

Voters
MemeManHimself
plscodeinjava
Comments
hotnewtop
CodingCactus

I swear you have posted this before…

plscodeinjava

@CodingCactus
Did you like it?

CodingCactus

¯\_(ツ)_/¯
clicking a square doesn't really interest me that much

plscodeinjava

@CodingCactus
DANG IT.... I thought EVERYONE would LOVE this tutorial

CodeLongAndPros

@amaddentcsec Project walkthroughs are frowned upon by me, don’t know about the rest though. The better kind of tutorials teach skills without much copypasta. But hey, whatever rows your canoe.

plscodeinjava

@CodeLongAndPros
This does teach a skill! It teaches you how to make a square clicker!

CodeLongAndPros

@amaddentcsec but that’s a specialized skill. Compare this to @DymanicSquid’s tutorial on memozation, or mine on bash.
You can use that to apply to many thing. Ain’t possible with this though.

plscodeinjava

@CodeLongAndPros
This could LITERALLY be applied to make BUTTONS in turtle. Think about that! BUTTONS in python turtle!!

CodeLongAndPros

@amaddentcsec Still specialized. Bash is on most computers, and memorization can be used anywhere.

plscodeinjava

@CodeLongAndPros
ngl im so sad... my two tutorials didnt get any upvotes

CodeLongAndPros

@amaddentcsec Well slow print is overrated, overused, and should never be used.

CodingCactus

@CodeLongAndPros

whatever rows your canoe.

bruuuuuuh you don't row a canoe, you paddle

CodeLongAndPros

@CodingCactus You paddle a kayak, you row a canoe, since it’s a two-person boat.

CodingCactus

@CodeLongAndPros hrmmmm but you use a paddle so surely it is paddling?

CodeLongAndPros

@CodingCactus but, when you swim, are you “arming”, since your use your arms?

CodingCactus

@CodeLongAndPros true i guess

CodingCactus
CodeLongAndPros

@CodingCactus Whatever compiles your code...

CodingCactus

@CodeLongAndPros lol
Have a good day : )

CodeLongAndPros

@CodingCactus Aye, can do. Now to fix my usb.

MemeManHimself

Hahah cool

plscodeinjava

@MemeManHimself
Yo thanks!!!
Also, how did you find this tutorial? It was posted like a week ago xD

plscodeinjava

@MemeManHimself
Yo how did i find this tutorial, it was posted ten months ago > <