From 7b62acdec4b606c70884cb37bf1dd8ad8e542c6a Mon Sep 17 00:00:00 2001 From: esHathck05 <46973649+esHathck05@users.noreply.github.com> Date: Tue, 29 Jan 2019 14:15:40 -0500 Subject: [PATCH 1/2] Create picture --- picture | 95 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 picture diff --git a/picture b/picture new file mode 100644 index 00000000..e9b62795 --- /dev/null +++ b/picture @@ -0,0 +1,95 @@ +from ggame import App + +from ggame import App, Color, LineStyle, Sprite +from ggame import RectangleAsset, CircleAsset, EllipseAsset, PolygonAsset + +# Three primary colors with no transparency (alpha = 1.0) +white = Color(0xfffff0, 1.0) +white2 = Color(0xf8f8ff, 1.0) +red = Color(0xff0000, 1.0) +red2 = Color(0xff0000, 0.5) +green = Color(0x00ff00, 1.0) +blue = Color(0x0000ff, 1.0) +black = Color(0x000000, 1.0) +yellow = Color(0xffff00 , 1.0) +yellow2 = Color(0xe9e900, 0.3) +brown = Color(0x8b4513, 1.0) +gray = Color(0xd3d3d3, 1.0) +dark_gray = Color(0x708090, 1.0) +light_blue = Color(0x6495ed, 0.2) +green = Color(0x006400, 1.0) + +# Define a line style that is a thin (1 pixel) wide black line +thinline = LineStyle(1, black) +# A graphics asset that represents a rectangle + +#window +window = RectangleAsset(50, 50, thinline, white) +window2 = RectangleAsset(50, 50, thinline, white) +window3 = RectangleAsset(50, 50, thinline, white) +window4 = RectangleAsset(50, 50, thinline, white) +windowpane = RectangleAsset(50, 50, thinline, yellow2) +windowpane2 = RectangleAsset(50, 50, thinline, yellow2) +windowpane3 = RectangleAsset(50, 50, thinline, yellow2) +windowpane4 = RectangleAsset(50, 50, thinline, yellow2) +windowframe = RectangleAsset(60, 60, thinline, brown) +windowframe2 = RectangleAsset(60, 60, thinline, brown) +windowframe3 = RectangleAsset(60, 60, thinline, brown) +windowframe4 = RectangleAsset(60, 60, thinline, brown) + +#Sky +sky = RectangleAsset(1000, 1000, thinline, light_blue) + +#Ground +ground = RectangleAsset(1000, 1000, thinline, green) + +#Main square of the house +house = RectangleAsset(300, 300, thinline, gray) + +#Roof +roof = PolygonAsset ([(0, 100), (200, 0), (400, 100), (0, 100)], thinline, dark_gray) + +#sun +sun = CircleAsset (70, thinline, yellow) + +#door +door = RectangleAsset(76, 140, thinline, brown) + +#Doorknob +doorknob = EllipseAsset(8, 5, thinline, white2) + +#door trim +doortrim = RectangleAsset(300, 15, thinline, white) + +#Sprites +Sprite(sky) +Sprite(ground, (0, 200)) +Sprite(house, (250, 150)) +Sprite(roof, (200, 50)) +Sprite(sun) +Sprite(doortrim, (250, 435)) +Sprite(door, (362, 310)) +Sprite(doorknob, (415, 370)) + +#Window 1 +Sprite(windowframe, (295, 195)) +Sprite(window, (300, 200)) +Sprite(windowpane, (300, 200)) + +#Window 2 +Sprite(windowframe2, (445, 195)) +Sprite(window2, (450, 200)) +Sprite(windowpane2, (450, 200)) + +#Window 3 +Sprite(windowframe3, (445, 325)) +Sprite(window3, (450, 330)) +Sprite(windowpane3, (450, 330)) + +#Window 4 +Sprite(windowframe4, (295, 325)) +Sprite(window4, (300, 330)) +Sprite(windowpane4, (300, 330)) + +myapp = App() +myapp.run() From fa8aef6300b2212cc7591c16266344fc7ee8886d Mon Sep 17 00:00:00 2001 From: esHathck05 <46973649+esHathck05@users.noreply.github.com> Date: Fri, 1 Feb 2019 14:14:29 -0500 Subject: [PATCH 2/2] Update picture.py --- picture.py | 91 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 89 insertions(+), 2 deletions(-) diff --git a/picture.py b/picture.py index 6e2a3e23..ab5a77e8 100644 --- a/picture.py +++ b/picture.py @@ -1,7 +1,7 @@ """ picture.py -Author: -Credit: +Author: Esther Hacker +Credit: N/A Assignment: @@ -28,6 +28,93 @@ # add your code here \/ \/ \/ +# Three primary colors with no transparency (alpha = 1.0) +white = Color(0xfffff0, 1.0) +white2 = Color(0xf8f8ff, 1.0) +red = Color(0xff0000, 1.0) +red2 = Color(0xff0000, 0.5) +green = Color(0x00ff00, 1.0) +blue = Color(0x0000ff, 1.0) +black = Color(0x000000, 1.0) +yellow = Color(0xffff00 , 1.0) +yellow2 = Color(0xe9e900, 0.3) +brown = Color(0x8b4513, 1.0) +gray = Color(0xd3d3d3, 1.0) +dark_gray = Color(0x708090, 1.0) +light_blue = Color(0x6495ed, 0.2) +green = Color(0x006400, 1.0) + +# Define a line style that is a thin (1 pixel) wide black line +thinline = LineStyle(1, black) +# A graphics asset that represents a rectangle + +#window +window = RectangleAsset(50, 50, thinline, white) +window2 = RectangleAsset(50, 50, thinline, white) +window3 = RectangleAsset(50, 50, thinline, white) +window4 = RectangleAsset(50, 50, thinline, white) +windowpane = RectangleAsset(50, 50, thinline, yellow2) +windowpane2 = RectangleAsset(50, 50, thinline, yellow2) +windowpane3 = RectangleAsset(50, 50, thinline, yellow2) +windowpane4 = RectangleAsset(50, 50, thinline, yellow2) +windowframe = RectangleAsset(60, 60, thinline, brown) +windowframe2 = RectangleAsset(60, 60, thinline, brown) +windowframe3 = RectangleAsset(60, 60, thinline, brown) +windowframe4 = RectangleAsset(60, 60, thinline, brown) + +#Sky +sky = RectangleAsset(1000, 1000, thinline, light_blue) + +#Ground +ground = RectangleAsset(1000, 1000, thinline, green) + +#Main square of the house +house = RectangleAsset(300, 300, thinline, gray) + +#Roof +roof = PolygonAsset ([(0, 100), (200, 0), (400, 100), (0, 100)], thinline, dark_gray) + +#sun +sun = CircleAsset (70, thinline, yellow) + +#door +door = RectangleAsset(76, 140, thinline, brown) + +#Doorknob +doorknob = EllipseAsset(8, 5, thinline, white2) + +#door trim +doortrim = RectangleAsset(300, 15, thinline, white) + +#Sprites +Sprite(sky) +Sprite(ground, (0, 200)) +Sprite(house, (250, 150)) +Sprite(roof, (200, 50)) +Sprite(sun) +Sprite(doortrim, (250, 435)) +Sprite(door, (362, 310)) +Sprite(doorknob, (415, 370)) + +#Window 1 +Sprite(windowframe, (295, 195)) +Sprite(window, (300, 200)) +Sprite(windowpane, (300, 200)) + +#Window 2 +Sprite(windowframe2, (445, 195)) +Sprite(window2, (450, 200)) +Sprite(windowpane2, (450, 200)) + +#Window 3 +Sprite(windowframe3, (445, 325)) +Sprite(window3, (450, 330)) +Sprite(windowpane3, (450, 330)) + +#Window 4 +Sprite(windowframe4, (295, 325)) +Sprite(window4, (300, 330)) +Sprite(windowpane4, (300, 330)) # add your code here /\ /\ /\