Skip to content

vs code #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
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
4 changes: 4 additions & 0 deletions Lab 01 - First Program/lab_01.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
print("Hello Class")
print("My name is Jayvyn Clarke")
print("I am taking class CSC 221")
print("Neil Armstrong said \"That's one small step for man, a giant leap for mankind.\"")
46 changes: 46 additions & 0 deletions Lab 02 - Draw a Picture/lab_02.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import arcade

arcade.open_window(800,600, "Drawing Example")

#Background Color
arcade.set_background_color(arcade.color.BRIGHT_NAVY_BLUE)

arcade.start_render()

#Draw Buildings
arcade.draw_rectangle_filled(600,20,100,700, arcade.color.COOL_GREY)
arcade.draw_rectangle_filled(400,60,100,800, arcade.color.LAVENDER_GRAY)
arcade.draw_rectangle_filled(300,80,100,700, arcade.color.DAVY_GREY)
arcade.draw_rectangle_filled(50,20,100,900, arcade.color.COOL_GREY)
arcade.draw_rectangle_filled(100,20,100,1000, arcade.color.LAVENDER_GRAY)
arcade.draw_rectangle_filled(800,20,100,900, arcade.color.DAVY_GREY)
arcade.draw_rectangle_filled(200,20,100,725, arcade.color.COOL_GREY)
arcade.draw_rectangle_filled(700,20,100,825, arcade.color.LAVENDER_GRAY)
arcade.draw_rectangle_filled(500,20,100,1000, arcade.color.DAVY_GREY)

#Draw Moon
arcade.draw_circle_filled(250,575,80, arcade.color.OLD_LACE)

#Draw Stars
arcade.draw_circle_filled(25,550,2, arcade.color.OLD_LACE)
arcade.draw_circle_filled(100,555,2, arcade.color.OLD_LACE)
arcade.draw_circle_filled(165,520,2, arcade.color.OLD_LACE)
arcade.draw_circle_filled(190,425,2, arcade.color.OLD_LACE)
arcade.draw_circle_filled(250,460,2, arcade.color.OLD_LACE)
arcade.draw_circle_filled(290,510,2, arcade.color.OLD_LACE)
arcade.draw_circle_filled(340,520,2, arcade.color.OLD_LACE)
arcade.draw_circle_filled(390,575,2, arcade.color.OLD_LACE)
arcade.draw_circle_filled(450,590,2, arcade.color.OLD_LACE)
arcade.draw_circle_filled(550,575,2, arcade.color.OLD_LACE)
arcade.draw_circle_filled(500,560,2, arcade.color.OLD_LACE)
arcade.draw_circle_filled(590,495,2, arcade.color.OLD_LACE)
arcade.draw_circle_filled(630,455,2, arcade.color.OLD_LACE)
arcade.draw_circle_filled(650,475,2, arcade.color.OLD_LACE)
arcade.draw_circle_filled(700,555,2, arcade.color.OLD_LACE)
arcade.draw_circle_filled(770,565,2, arcade.color.OLD_LACE)




arcade.finish_render()
arcade.run()
46 changes: 46 additions & 0 deletions Lab 03 - Draw Using Functions/lab_03.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import arcade

SCREEN_WIDTH = 800
SCREEN_HEIGHT = 600

def draw_grass():
# Ground
arcade.draw_lrtb_rectangle_filled(0, SCREEN_WIDTH, SCREEN_HEIGHT / 3,0, arcade.color.AIR_SUPERIORITY_BLUE)

def draw_snow_person(x, y):

arcade.draw_point(x, y, arcade.color.RED,5)
# Snow
arcade.draw_circle_filled(x, 60 + y, 60, arcade.color.WHITE)
arcade.draw_circle_filled(x, 140 + y, 50, arcade.color.WHITE)
arcade.draw_circle_filled(x, 200 + y, 40, arcade.color.WHITE)


# Eyes
arcade.draw_circle_filled(x - 15, 210 + y, 5, arcade.color.BLACK)
arcade.draw_circle_filled(x + 15, 210 + y, 5, arcade.color.BLACK)

def on_draw(delta_time):
arcade.start_render()

draw_grass()
draw_snow_person(on_draw.snow_person1_x, 140)
draw_snow_person(on_draw.snow_person2_x, 140)
draw_snow_person(on_draw.snow_person3_x, y=140)

on_draw.snow_person1_x += 1
on_draw.snow_person2_x += 1
on_draw.snow_person3_x += 1

on_draw.snow_person1_x = 150
on_draw.snow_person2_x = 350
on_draw.snow_person3_x = 500

def main():
arcade.open_window(SCREEN_WIDTH, SCREEN_HEIGHT, "Drawing with Functions")
arcade.set_background_color(arcade.color.DARK_BLUE)

arcade.schedule(on_draw, 1 / 60)
arcade.run()

main()
81 changes: 81 additions & 0 deletions Lab 04 - Camel/lab_04.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
import arcade
import random

def main():
print("Welcome to the Camel Game!")
print("You have stolen a camel to make your way across the great Mobi desert.")
print("The natives want their camel back and are chasing you down! Survive your\ndesert trek and outrun the natives.")

miles_traveled = 0
thrist = 0
camel_tiredness = 0
natives_distance = -20
drinks_in_canteen = 6


done = False

while not done:

print("A. Drink from your canteen")
print("B. Ahead moderate speed.")
print("C. Ahead full speed.")
print("D. Stop for the Night.")
print("E. Status check.")
print("Q. Quit.")

user_choice = input("What's your choice? ").upper()

if user_choice == "Q":
done = True
print("You have successfully quit")
elif user_choice == "E":
print(f"You have traveled {miles_traveled}.")
print(f"You have {drinks_in_canteen} in your canteen.")
print(f"The Natives are {natives_distance} miles behind you.")
elif user_choice == "D":
camel_tiredness = 0
print("Camel has Rested.")
natives_distance += random.randrange(7,14)
print("The natives are catching up!")
elif user_choice == "C":
miles = random.randrange(10,20)
miles_traveled += miles
print(f"You have traveled {miles} miles.")
thrist += 1
camel_tiredness += random.randrange(1,3)
natives_distance += random.randrange(7,14)
if random.randrange(20) == 5:
print("You have found a rare oasis!")
drinks_in_canteen = 6
elif user_choice == "B":
miles = random.randrange(5,12)
miles_traveled += miles
print(f"You have traveled {miles} miles.")
thrist += 1
camel_tiredness = +1
natives_distance += random.randrange(7,14)
elif user_choice == "A":
if drinks_in_canteen > 0:
drinks_in_canteen -= 1
thrist = 0
if thrist >= 6:
print("You have died of thirst!!!")
done = True
if camel_tiredness >= 5:
print("Your camel needs to rest")
if camel_tiredness >= 8:
print("Your camel has collapsed from dehydration")
done = True
if natives_distance >= miles_traveled:
print("The natives have caught up!")
done = True
elif natives_distance >= 15:
print("The natives are getting close!")
if miles_traveled >= 200:
print("You have made it across the desert!!!\nCONGRATULATIONS YOU BEAT THE GAME!")
if random.randrange(20) == 5:
print("You have found a rare oasis!")


main()
131 changes: 131 additions & 0 deletions Lab 05 - Loopy Lab/lab_05.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
import arcade


def draw_section_outlines():
# Draw squares on bottom
arcade.draw_rectangle_outline(150, 150, 300, 300, arcade.color.BLACK)
arcade.draw_rectangle_outline(450, 150, 300, 300, arcade.color.BLACK)
arcade.draw_rectangle_outline(750, 150, 300, 300, arcade.color.BLACK)
arcade.draw_rectangle_outline(1050, 150, 300, 300, arcade.color.BLACK)

# Draw squares on top
arcade.draw_rectangle_outline(150, 450, 300, 300, arcade.color.BLACK)
arcade.draw_rectangle_outline(450, 450, 300, 300, arcade.color.BLACK)
arcade.draw_rectangle_outline(750, 450, 300, 300, arcade.color.BLACK)
arcade.draw_rectangle_outline(1050, 450, 300, 300, arcade.color.BLACK)


def draw_section_1():
for row in range(30):
for column in range(30):
x = 5 + column * 10 # Instead of zero, calculate the proper x location using 'column'
y = 5 + row * 10 # Instead of zero, calculate the proper y location using 'row'
arcade.draw_rectangle_filled(x, y, 5, 5, arcade.color.WHITE)


def draw_section_2():
for row in range(30):
for column in range(30):
x = 305 + column * 10
y = 295 - row * 10
if column % 2 == 0:
arcade.draw_rectangle_filled(x,y,5,5,arcade.color.WHITE)
else:
arcade.draw_rectangle_filled(x,y,5,5,arcade.color.BLACK)



def draw_section_3():
for column in range(30):
for row in range(30):
x = 605 + column * 10
y = 295 - row * 10
if row % 2 == 0:
arcade.draw_rectangle_filled(x,y,5,5,arcade.color.WHITE)
else:
arcade.draw_rectangle_filled(x,y,5,5,arcade.color.BLACK)


def draw_section_4():
for column in range(30):
for row in range(30):
x = 905 + column * 10
y = 295 - row * 10
if row % 2 == 0:
arcade.draw_rectangle_filled(x,y,5,5,arcade.color.BLACK)
else:
arcade.draw_rectangle_filled(x,y,5,5,arcade.color.BLACK)
# Use the modulus operator and just one 'if' statement to select the color.



def draw_section_5():
for column in range(30):
for row in range(column, 30):
x = 5 + (29 - column) * 10
y = 595 - row * 10
arcade.draw_rectangle_filled(x, y, 5, 5, arcade.color.WHITE)


# Do NOT use 'if' statements to complete 5-8. Manipulate the loops instead.



def draw_section_6():
for column in range(30):
for row in range(column, 30):
x = 305 + column * 10
y = 595 - row * 10
arcade.draw_rectangle_filled(x,y,5,5,arcade.color.WHITE)



def draw_section_7():
for row in range(30):
for column in range(30 - row):
x = 605 + column * 10
y = 595 - row * 10
arcade.draw_rectangle_filled(x,y,5,5,arcade.color.WHITE)


def draw_section_8():
for row in range(30):
for column in range(row, 30):
x = 905 + column * 10
y = 595 - row * 10
arcade.draw_rectangle_filled(x, y, 5, 5, arcade.color.WHITE)









def main():
# Create a window
arcade.open_window(1200, 600, "Lab 05 - Loopy Lab")
arcade.set_background_color(arcade.color.AIR_FORCE_BLUE)

arcade.start_render()

# Draw the outlines for the sections
draw_section_outlines()

# Draw the sections
draw_section_1()
draw_section_2()
draw_section_3()
draw_section_4()
draw_section_5()
draw_section_6()
draw_section_7()
draw_section_8()

arcade.finish_render()

arcade.run()


main()
Loading