Exemplo n.º 1
0
def draw_row(tortoise, color1, color2):
    t = tortoise
    for i in range(int(8 / 2)):
        width = 50
        t.fillcolor(color1)
        t.begin_fill()
        square.draw_square(t, width)
        t.end_fill()
        t.forward(width)
        t.fillcolor(color2)
        t.begin_fill()
        square.draw_square(t, width)
        t.end_fill()
        t.forward(width)
Exemplo n.º 2
0
    def get_sprites(self):
        sprites = []
        squares = self.tetromino.get_position()
        for square in squares:
            pos_x = square[0]
            pos_y = square[1]
            x = pos_x * BLOCK_WIDTH + PLAYFIELD_COORD_X
            y = pos_y * BLOCK_WIDTH + PLAYFIELD_COORD_Y
            sprites.append(draw_square(x, y, self.batch, self.tetromino.color))

        squares = self.tetrion.get_squares()
        for square in squares:
            pos_x = square[0]
            pos_y = square[1]
            x = pos_x * BLOCK_WIDTH + PLAYFIELD_COORD_X
            y = pos_y * BLOCK_WIDTH + PLAYFIELD_COORD_Y
            sprites.append(draw_square(x, y, self.batch, self.tetrion.color))

        return sprites
Exemplo n.º 3
0
def main():
    square = get_square()
    draw_square(square)
Exemplo n.º 4
0
from turtle import *
import coordinates
import square
import linear
import quadratic

border = {"width": 620, "height": 620}

# draw square and coordinate
print("< Jeffrey's Plotting Software >")
print("drawing rectangular coordinates...")
square.draw_square(border["width"], border["height"], -310, -300)
penup()
setx(0)
sety(0)
pendown()
coordinates.draw_coordinate()

draw_finished = False
while not draw_finished:
    function_type = int(input("linear : 1, quadratic : 2 "))
    if (function_type == 1):
        slope = int(input("type the slope : "))
        y_incpt = int(input("type the y intercept : "))
        linear.linear(slope, y_incpt)
    if (function_type == 2):
        a = float(input("type a : "))
        b = int(input("type b : "))
        c = int(input("type c : "))
        quadratic.quadratic(a, b, c)
    draw_ends = input("press N to finish drawing. ")
Exemplo n.º 5
0
def draw(square):
    draw_square(square)
Exemplo n.º 6
0
from turtle import *
from square import draw_square

for i in range(30):
    draw_square(i * 5, 'red')
    left(17)
    penup()
    forward(i * 2)
    pendown()
Exemplo n.º 7
0
 def draw(self):
     draw_square(self)
Exemplo n.º 8
0
import turtle
from square import draw_square
from triangle import *
from circle import draw_circle
from config import *

window = turtle.Screen()
window.screensize(canvwidth=500, canvheight=500, bg="black")

pencil = turtle.Turtle()

configPencil(pencil, 6)

draw_square(pencil, 300, 90)

pencil.fd(150)
draw_circle(pencil, 150)

moveTurtleBeforeTriangle(pencil, 300, 90)

pencil.left(116.5)
draw_triangle(pencil, 335, 116.5)

window.exitonclick()
from turtle import *
from square import draw_square

for i in range(30):
    draw_square(i * 5, "red")
    left(17)
    penup()
    forward(i * 2)
    pendown()