Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions draw_with_functions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#! /usr/bin/python3.6
import arcade
import random

SCREEN_WIDTH = 450
SCREEN_HEIGHT = 500
Expand All @@ -12,17 +13,20 @@ def stickman(x,y):
arcade.draw_rectangle_filled(x,y,10,100, arcade.color.DARK_CANDY_APPLE_RED)
arcade.draw_point(x, y + 20, arcade.color.DARK_GOLDENROD,50)

def letter():
# add your code here
pass
def draw_t(x,y):
arcade.draw_rectangle_filled(x,y-50,20,100, arcade.color.PURPLE)
arcade.draw_rectangle_filled(x,y,100,20, arcade.color.PURPLE)


def draw_random(object):
x = random.randint(1,450)
y = random.randint(1,450)
draw_t(x,y)

def draw_random():
# add your code here
pass

# functions below draw different shapes.
# you call them using the function name, and the object to draw is
# inside the ()
# inside the ()

def draw_horizontal(object):
for x in range (1, 9):
Expand Down Expand Up @@ -63,7 +67,8 @@ def pyramid(object, y, how_many):
pyramid(object, y, how_many)

# move call to draw_x function to menu
draw_x (stickman)
# draw_x (stickman)
draw_random(draw_t)

'''
# Menu
Expand All @@ -78,6 +83,5 @@ def pyramid(object, y, how_many):
elif pattern == 'p':
draw_pyramid(stickman, 25, 10)
'''

arcade.finish_render()
arcade.run()
2 changes: 1 addition & 1 deletion pong.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# Size of the screen
SCREEN_WIDTH = 300
SCREEN_HEIGHT = 300
SCREEN_TITLE = "Pong"
SCREEN_TITLE = "Trevors Pong"

# Size of the rectangle
PADDLE_WIDTH = 10
Expand Down