I have taken the d-pad as defined in my previous

submission and created a function to encapsulate it.

This wasn't as difficult as I made it out to be as I was still attempting to fully understand the concept.
I realized that I could define the function as what I was making. When I figured this out, the rest came to me
and I was able to reorganize my shape to fit inside the function. Much of getting it to work was trial-and-error,
and as such it felt earned to figure it out. My next major step involves making an attempt to introduce an
argument into the function, and specifically allow for my d-pad to scale in size in order to make either a smaller
d-pad inside of the current one or to even offset for a bit of a 3D effect.
This commit is contained in:
Justin Toombs 2023-07-23 20:59:28 -04:00
parent 5dea44d02f
commit 1bf68ab503
1 changed files with 17 additions and 17 deletions

View File

@ -6,21 +6,21 @@
from turtle import *
import turtle
screen = turtle.Screen()
screen.setup(1000,1000)
turtle.color('blue')
turtle.up()
turtle.goto(-450,-150)
turtle.down()
turtle.begin_fill()
for _ in range(4):
turtle.fd(300)
turtle.right(90)
turtle.fd(300)
turtle.left(90)
turtle.fd(300)
turtle.left(90)
turtle.end_fill()
def dpad():
screen = turtle.Screen()
screen.setup(1000,1000)
turtle.color('blue')
turtle.up()
turtle.goto(-450,-150)
turtle.down()
turtle.begin_fill()
for _ in range(4):
turtle.fd(300)
turtle.right(90)
turtle.fd(300)
turtle.left(90)
turtle.fd(300)
turtle.left(90)
turtle.end_fill()
dpad()
done()