generated from mwc/project_drawing
First milestone is done
I finished writing the code for the checker board, the tiles on it, and the playing coins. This part was pretty simple i was just making all the shapes i would need for the board game. Something I figured out how to do was fill in color to what I draw.
This commit is contained in:
43
shapes.py
Normal file
43
shapes.py
Normal file
@@ -0,0 +1,43 @@
|
||||
from turtle import *
|
||||
|
||||
def board(side_length):
|
||||
"Out line of the board"
|
||||
sides = [side_length, side_length, side_length, side_length]
|
||||
for sides in sides:
|
||||
pensize(4)
|
||||
forward(sides)
|
||||
right(90)
|
||||
|
||||
|
||||
def square(size):
|
||||
"Draws a square of side length `size`"
|
||||
for side in range(4):
|
||||
forward(size)
|
||||
left(90)
|
||||
|
||||
def black_tile(size):
|
||||
begin_fill()
|
||||
fillcolor('black')
|
||||
square(size)
|
||||
end_fill()
|
||||
|
||||
|
||||
def white_tile(size):
|
||||
begin_fill()
|
||||
fillcolor('white')
|
||||
square(size)
|
||||
end_fill()
|
||||
|
||||
|
||||
def red_coin(size):
|
||||
begin_fill()
|
||||
fillcolor('red')
|
||||
circle(size)
|
||||
end_fill()
|
||||
|
||||
|
||||
def blue_coin(size):
|
||||
begin_fill()
|
||||
fillcolor('blue')
|
||||
circle(size)
|
||||
end_fill()
|
||||
Reference in New Issue
Block a user