Skip to content

Completed course #8

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 32 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
58a394f
Work on lab 1
EC-RMIXON Jan 11, 2023
b115401
First attempt lab 1 -rm
EC-RMIXON Jan 13, 2023
5a8d7ed
Update lab_01.py
RobMixon Jan 13, 2023
c87bc5b
added scratch work folder
EC-RMIXON Jan 16, 2023
c1b6bcd
Merge branch 'master' of https://github.com/RobMixon/learn-arcade-work
EC-RMIXON Jan 16, 2023
8443359
building a house
EC-RMIXON Jan 17, 2023
18253ec
finish drawing rm
EC-RMIXON Jan 17, 2023
72cba11
added lines to windows
EC-RMIXON Jan 17, 2023
136a575
slowly working on this
EC-RMIXON Jan 27, 2023
65e8c81
finished lab 3
EC-RMIXON Feb 1, 2023
ec077eb
added another function to be sure
EC-RMIXON Feb 1, 2023
38b37c6
basic structure built
EC-RMIXON Feb 7, 2023
565f0cb
finished tweaking game
EC-RMIXON Feb 7, 2023
2eb3e6f
cleaned up code
EC-RMIXON Feb 7, 2023
fdfd387
square 1 done
EC-RMIXON Feb 16, 2023
a912a6f
still working on 8
EC-RMIXON Feb 17, 2023
f9e9297
cant figure out 8
EC-RMIXON Feb 17, 2023
e3f12da
finally figured out 8
EC-RMIXON Feb 17, 2023
a6f4f35
finished lab six
EC-RMIXON Feb 28, 2023
4c74bab
cleaned up code
EC-RMIXON Feb 28, 2023
73d1515
adding comments
EC-RMIXON Feb 28, 2023
218c20a
initial for lab 7
EC-RMIXON Mar 18, 2023
22548b3
updates
EC-RMIXON Mar 19, 2023
0440992
cleaned up some minor stuff and played with more sounds
EC-RMIXON Mar 19, 2023
55cb421
stuff
EC-RMIXON Mar 23, 2023
5b493dc
adding movement
EC-RMIXON Mar 25, 2023
1110ef4
finished
EC-RMIXON Mar 25, 2023
167a1e9
completed all requirements
EC-RMIXON Apr 1, 2023
47ed92e
word search complete
EC-RMIXON Apr 8, 2023
a82d12e
working on final
RobMixon Apr 17, 2023
44af54c
finished up game
RobMixon Apr 22, 2023
03b74cf
completed course
RobMixon Dec 11, 2023
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
14 changes: 14 additions & 0 deletions Lab 01 - First Program/lab_01.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
firstName = str("Rob")
lastName = str('Mixon')
age = int(30)
# cant use backticks for string interpolation
print(type(firstName))
print(type(age))
print(f'Hello, my name is {firstName} {lastName}.')
print(f'"I am \n {age} \n years \n old."')
print("""I really
wish
that I
could use backticks....""")
print('Where are the semicolons????')

62 changes: 62 additions & 0 deletions Lab 02 - Draw a Picture/lab_02.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import arcade

arcade.open_window(800, 800, "landscape")

#background color
arcade.set_background_color((27, 27, 27))

arcade.start_render()

#Start Drawing
#Ground
arcade.draw_lrtb_rectangle_filled(0, 799, 300, 0, (26, 36, 33))

#House
arcade.draw_lrtb_rectangle_filled(300, 700, 500, 250, arcade.color.JET)

#Chimney
arcade.draw_lrtb_rectangle_filled(600, 650, 625, 500, (20, 20, 20))

#Roof
arcade.draw_triangle_filled(300, 500, 500, 600, 700, 500, (43, 43, 43))

#Door
arcade.draw_lrtb_rectangle_filled(600, 650, 350, 250, arcade.color.DARK_BROWN)

#Door Handle
arcade.draw_circle_filled(610, 290, 3, arcade.color.BLACK)

#Door Window
arcade.draw_ellipse_outline(625, 320, 30, 50, arcade.color.BLACK)

#Light From House
arcade.draw_ellipse_filled(625, 320, 28, 48, arcade.color.DARK_YELLOW)
arcade.draw_rectangle_filled(420, 320, 123, 48, arcade.color.DARK_YELLOW)
arcade.draw_rectangle_filled(420, 450, 58, 58, arcade.color.DARK_YELLOW)
arcade.draw_rectangle_filled(625, 450, 58, 58, arcade.color.DARK_YELLOW)

#Window at Ground Level
arcade.draw_rectangle_outline(420, 320, 125, 50, arcade.color.BLACK, 2)

#Upper Windows
arcade.draw_rectangle_outline(420, 450, 60, 60, arcade.color.BLACK, 2)
arcade.draw_rectangle_outline(625, 450, 60, 60, arcade.color.BLACK, 2)
arcade.draw_line(390, 450, 450, 450, arcade.color.BLACK, 2)
arcade.draw_line(595, 450, 655, 450, arcade.color.BLACK, 2)

#moon
arcade.draw_circle_filled(100, 650, 50, arcade.color.GHOST_WHITE)
arcade.draw_circle_filled(120, 650, 40, (27, 27, 27))

#stars
point_list = ((165, 495), (200, 760), (250, 700), (270, 650), (400, 670),
(450, 780), (490, 620), (510, 730), (525, 700), (560, 630),
(600, 760), (610, 690), (650, 650), (690, 730), (700, 700),
(724, 665), (740, 615), (770, 720), (775, 705), (180, 770))
arcade.draw_points(point_list, arcade.color.GHOST_WHITE, 2)

# Finish drawing
arcade.finish_render()

# Keep the window up until someone closes it.
arcade.run()
84 changes: 84 additions & 0 deletions Lab 03 - Draw Using Functions/lab_03.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
import arcade
import random
from arcade.examples.sprite_explosion_particles import PARTICLE_FADE_RATE

Screen_Width = 1000
Screen_Height = 800
star_coordinate_list = []

def draw_light_from_house():
arcade.draw_ellipse_filled(625, 320, 28, 48, arcade.color.DARK_YELLOW)
arcade.draw_rectangle_filled(420, 320, 123, 48, arcade.color.DARK_YELLOW)

def draw_upper_windows(x, y):
arcade.draw_rectangle_filled(x, y, 58, 58, arcade.color.DARK_YELLOW)
arcade.draw_rectangle_outline(x, y, 60, 60, arcade.color.BLACK, 2)
arcade.draw_line(x - 30, y, x + 30, y, arcade.color.BLACK, 2)
arcade.draw_line(x, y - 30, x, y + 30, arcade.color.BLACK, 2)

def draw_house():
arcade.draw_lrtb_rectangle_filled(300, 700, 500, 250, arcade.color.JET)
arcade.draw_lrtb_rectangle_filled(600, 650, 625, 500, (20, 20, 20))
arcade.draw_triangle_filled(300, 500, 500, 600, 700, 500, (43, 43, 43))
arcade.draw_lrtb_rectangle_filled(600, 650, 350, 250, arcade.color.DARK_BROWN)
arcade.draw_circle_filled(610, 290, 3, arcade.color.BLACK)
arcade.draw_ellipse_outline(625, 320, 30, 50, arcade.color.BLACK)
arcade.draw_rectangle_outline(420, 320, 125, 50, arcade.color.BLACK, 2)

def stars(point_list):
arcade.draw_points(point_list, arcade.color.GHOST_WHITE, 2)

def moon(x, y):
arcade.draw_circle_filled(x, y, 50, arcade.color.GHOST_WHITE)
arcade.draw_circle_filled(x + 20, y, 40, (27, 27, 27))

def ground():
arcade.draw_lrtb_rectangle_filled(0, 999, 300, 0, (26, 36, 33))

def tree(x, y):
arcade.draw_rectangle_filled(x, y, 30, 60, (69, 41, 19))
arcade.draw_triangle_filled(x - 30, y + 30, x, y + 70, x + 30, y + 30, arcade.color.DARK_GREEN)
arcade.draw_triangle_filled(x - 30, y + 60, x, y + 100, x + 30, y + 60, arcade.color.DARK_GREEN)
arcade.draw_triangle_filled(x - 30, y + 90, x, y + 130, x + 30, y + 90, arcade.color.DARK_GREEN)

def main():
arcade.open_window(Screen_Width, Screen_Height, "landscape")

# background color
arcade.set_background_color((27, 27, 27))

arcade.start_render()

# Start Drawing
ground()

for x in range(0, 100):
x_stars = random.randint(0, 1000)
y_stars = random.randint(400, 800)
x_and_y_object = (x_stars, y_stars)
star_coordinate_list.append(x_and_y_object)

stars(star_coordinate_list)

# House
draw_house()

draw_light_from_house()
draw_upper_windows(390, 450)
draw_upper_windows(505, 450)
draw_upper_windows(620, 450)
moon(100, 650)

tree(50, 290)
tree(120, 290)
tree(850, 290)
tree(920, 290)

# Finish drawing
arcade.finish_render()

# Keep the window up until someone closes it.
arcade.run()

# calling the main function
main()
180 changes: 180 additions & 0 deletions Lab 04 - Camel/lab_04.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
# import statements
import random


# natives move up function
def natives_move_up(): return random.randrange(0, 14)

# full speed function
def full_speed(): return random.randrange(10, 20)

# moderate speed function
def moderate_speed(): return random.randrange(5, 12)

# camel tiredness function
def camel_tiredness_function(): return random.randrange(1, 3)

# oasis chance function
def oasis_chance(): return random.randrange(1, 20)

# defining main function
def main():
# variables
done = False
miles_traveled = 190
thirst = 0
camel_tiredness = 0
natives_traveled = -20
canteen = 3
oasis = random.randrange(1, 20)

# Initial statement
print("Welcome to Camel!")
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")
print("desert trek and out run the natives.")
print("")

# starting while loop
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.")
print("")
user_choice = input("What is your choice? ")
print("")

# quit statement
if user_choice.upper() == "Q":
print("Y: Yes")
print("N: No")
print("")
user_quit_choice = input("What is your choice? ")

# quit check
if user_quit_choice.upper() == "Y":
print("You have exited the game")
done = True

# status check
elif user_choice.upper() == "E":
print("Miles traveled:", miles_traveled)
print("Drinks left in canteen:", canteen)
print("The natives are", miles_traveled - natives_traveled, "miles behind you!")
print("")

# stop for the night
elif user_choice.upper() == "D":
camel_tiredness = 0
natives_move = natives_move_up()
natives_traveled = natives_traveled + natives_move
print("The camel is happy! The natives move up", natives_move, "miles.")
print("")

# full speed
elif user_choice.upper() == "C":
full_speed_user = full_speed()
full_speed_natives = natives_move_up()
miles_traveled = miles_traveled + full_speed_user
natives_traveled = natives_traveled + full_speed_natives
camel_tiredness = camel_tiredness + camel_tiredness_function()
thirst = thirst + 1
full_speed_oasis = oasis_chance()
print("You have traveled", full_speed_user, "miles.")
print("Camel tiredness:", camel_tiredness)
print("The natives move up", full_speed_natives, "miles.")
if oasis == full_speed_oasis:
canteen = 3
thirst = 0
camel_tiredness = 0
print("You found an oasis!")
print("Drinks left in canteen:", canteen)
print("Thirst:", thirst)
print("Camel tiredness:", camel_tiredness)
print("")
else:
print("")

# moderate speed
elif user_choice.upper() == "B":
moderate_speed_user = moderate_speed()
moderate_speed_natives = natives_move_up()
miles_traveled = miles_traveled + moderate_speed_user
natives_traveled = natives_traveled + moderate_speed_natives
camel_tiredness = camel_tiredness + 1
thirst = thirst + 1
moderate_speed_oasis = oasis_chance()
print("You have traveled", moderate_speed_user, "miles.")
print("Camel tiredness:", camel_tiredness)
print("The natives move up", moderate_speed_natives, "miles.")
if oasis == moderate_speed_oasis:
canteen = 3
thirst = 0
camel_tiredness = 0
print("You found an oasis!")
print("Drinks left in canteen:", canteen)
print("Thirst:", thirst)
print("Camel tiredness:", camel_tiredness)
print("")
else:
print("")

# Drink from canteen
elif user_choice.upper() == "A":
if canteen != 0:
print("You take a drink from your canteen.")
canteen = canteen - 1
thirst = 0
print("")
else:
print("You have no more water!")
print("")

# you are thirsty
if 4 <= thirst < 6:
print("You are thirsty!")
print("")

# you died of thirst
elif thirst >= 6:
print("You died of thirsty!")
print("")
done = True

if not done:
# your camel is getting tired
if 5 <= camel_tiredness < 8:
print("Your camel is getting tired.")
print("")

# your camel is dead
elif camel_tiredness >= 8:
print("Your camel is dead.")
print("")
done = True

if not done:
# if the natives have caught up
if natives_traveled >= miles_traveled:
print("The natives have caught you.")
print("")
done = True

# the natives are getting close
elif natives_traveled >= miles_traveled - 10:
print("The natives are getting close!")
print("")

if not done:
# winning statement
if miles_traveled >= 200:
print("You won and got the camel across the desert! Congrats on being alive!")
print("")
done = True


# calling the main function
main()
Loading