Fusion 25-26

“You don’t have to see the whole staircase, just take the first step.” – Martin Luther King, Jr. 

  • Photo of Lego bricks

    https://www.ebay.ca/itm/284319734604

    Fusion Planetary Exploration Project

    Overview

    The Fusion Planetary Exploration Project challenges us to investigate a potential celestial body suitable for inhabitation. The choice that stood out most to us was a famous one of Saturn’s 274 moons, Titan.

    One of our primary reasons for choosing Titan is its proximity to the Earth relative to other Earth-like planets/moons. Being 1.2 billion kilometres, and about 6-7 years of continuous space travel away from us, as compared to the thousands of light-years of others, there is a real possibility of human reach extending out to this moon.

    Opportunities

    Aside from its proximity, Titan’s surface is made primarily of ice, which covers a rocky surface that allows space vehicles to land on. We can find important opportunities in these lands, as well as take inspiration from many of the ISS’s methods of sustaining life. Firstly, we can obtain a sustainable water source through recycling urine. As NASA’s recent report on “Environmental Control & Life Support Systems” suggests, this process is achieved through firstly separating the nutrients found in urine from the waste liquid, before distilling this liquid to capture the remaining, drinkable water that is then stored in a urine brine. Alongside consumable water, this procedure allows us to recover key nutrients such as phosphorus and nitrogen to be used in fertilizer, which helps us create farms on Titan. This process may be supplemented, especially in emergencies, by melting Titan’s vast icy surface for water.

    Due to Titan’s lack of oxygen in its atmosphere, we must make use of the ISS’s invention of electrolysis. As stated by NASA’s recent report, this process uses large plots of solar panels to capture the energy required to decompose water (H2O) into Hydrogen (H) and Oxygen (O) for us to breathe. The supply of water may be found not only in the urine recycling process, but also be kick-started by melting Titan’s unique, icy surface. We can make use of its extensive sheets of ice to obtain the initial water needed to begin water recycling and electrolysis (oxygen creation), rather than mandating the water to be transported from Earth.

    Alongside this, Titan has a thick atmosphere made up of methane and nitrogen, which works to provide the moon with a strong greenhouse effect that protects it from radiation. The hundreds of lakes of hydrocarbon composites, as well as rain formed from hydrocarbon clouds, can be used as a sustainable fuel for machinery, and imply the possibility of long-term human habitation. Hydrocarbons are known as highly-effective fuel sources due to their energy density, safety of use, and ease of storage and transportation. Titan’s complex terrains mandate the efficient collection and transportation of Titan’s abundance of raw materials, which Hydrocarbon properties are suitable for.

    Because of Titan’s many properties that allow it the ability to support, accommodate, and potentially sustain human life, we believe it to be the most suitable candidate for human inhabitation.

    Challenges

    Despite these promising opportunities, we must not overlook the significant challenges that oppose human inhabitation on Titan. Currently, the two greatest challenges we face include the extreme cold of the atmosphere and the limitations for mass human population. Firstly, due to its remoteness from the sun, being outside the habitable zone, Titan lacks the necessary heat to allow for unmoderated human activity. The conditions of Titan, often reaching -180°C, prompt us to limit our activities to indoors. Our movement may be significantly limited on Titan due to the requirement of heavy clothing and accessories, which may limit our ability to develop appropriate infrastructures and life-sustaining systems on Titan.

    Secondly, and perhaps more importantly, there are expected limitations for a large human population. The proposed solutions to creating sustainable water and oxygen sources and to creating fertilizers for farms assume their use for small communities. Processes such as electrolysis require large plots of solar panels, which, when combined with the delicate structures used in urine recycling and the requirement for humans to live indoors, limit the possibility of great infrastructural developments over a short period of time. The ISS’s size reflects this limited growth. Although we are free to use far larger lands on Titan, its distance from Earth restricts the efficient shipping of essential materials to build structures that can host larger human populations.

    Lastly, Titan’s distance away from Earth, mandating 14-16 years for a round-trip, means that the inhabitants of Titan cannot make emergency contact with Earth. Emergency aid will not reach Titan in time to be serviceable, and difficult situations, such as system failure in urine recycling or electrolysis, that require immediate attention cannot be addressed.

    Vehicle Implications

    Appropriate vehicle design would need to accommodate the extreme cold temperatures of Titan. Inhabiters will likely be limited to indoor activities or select outdoor ones with spacesuits. Before official habitation, we must set up large plots of solar panels, indoor-suited infrastructures, drills that allow us to dig into Titan’s underground ocean, and functioning life-sustaining systems that work against the temperature.

    Because of Titan’s lower gravity, at around 1.352 m/s² compared to Earth’s 9.807 m/s², vehicle designs require a way to keep it tight to the ground. This issue should be easily approached, as adding spikes on vehicle treads will allow it to grip Titan’s icy surface, similar to the use of studded tires on a snow bike. An appropriate vehicle for Titan must also be able to withstand the moon’s extreme temperatures and allow for remote control of the vehicle without signals. Due to Titan’s thick atmosphere, blockading radio waves and other forms of electromagnetic radiation, we may need to find a workaround for remote control. Pre-programmed and tested directions can serve as an alternative to remote control, albeit with differing probabilities for success as compared to remote control, based on the situation and use case.

    How can we be certain of this information?

    Our primary source of knowledge about Titan was found through the “Cassini-Huygens” mission. This mission consisted of two important elements. The “Cassini” was a spacecraft designed to orbit and collect data about Saturn. Attached to it, the “Huygens” was a probe designed to land on its largest moon, Titan. As stated by NASA’s Cassini mission report, the spacecraft and probe’s numerous gravity measurements of Titan revealed the liquid water and ammonia ocean beneath its surface, as well as data for multiple lakes and other bodies of liquid methane and ethane, replenished by rain from hydrocarbon clouds.

    The Huygen Probe recorded videos, snapping images, and collecting data on Titan’s atmosphere, including its temperature, pressure, density, and chemical composition (nitrogen-rich) during its 2-hour descent. Upon landing, the probe traversed Titan’s surface for over an hour before running out of battery. Delving into a deeper understanding of the spacecraft and probe’s data collection methods, the Huygen carried many technologies that continuously transmitted information from the probe to the mother “Cassini”.

    Firstly, the Huygens Atmospheric Structure Instrument (HASI) used a suite of physical, electrical, and thermal sensors to determine the atmospheric properties of Titan. Accelerometers were used to measure the speed of descent of the probe, which, when combined with the information of its weight and the resistance the probe faced, allowed scientists to understand the density of the atmosphere. This, combined with the Chromatograph Mass Spectrometer (GCMS), which was equipped with samplers that tested for the atmosphere’s chemical composition, provided evidence for a Nitrogen-rich atmosphere.

    Secondly, the Descent Imager/Spectral Radiometer (DISR) used a range of imaging observations using several sensors and perspectives to create vivid images of Titan. Notably, two imagers, a visible and an infrared, took 360-degree photos of the Huygen Probe’s surroundings during its 2-hour descent. Combined with a side-view imager and a small lamp that adapted its brightness based on the presence of sunlight, provided us with a relatively accurate image of Titan’s physical appearance.

    Lastly, the Surface-Science Package (SSP) was a package that contained multiple sensors designed to collect information about Titan’s surface upon the Huygen Probe’s landing. Notably, an acoustic sensor measured the volatility of the probe’s distance to the ground as it landed the last 100 meters (Volatility would remain low against a solid surface, but fluctuate against ocean waves). The above-mentioned accelerometer measured the probe’s deceleration, which suggested the structure and softness of the surface, while a tilt sensor measured any swinging motion during the Probe’s descent (potentially caused by strong winds).

    This collected information was continuously transmitted from the probe to the mother “Cassini”. Despite the short duration of the landing, the “Cassini-Huygens” mission provided scientists with a renewed and sophisticated understanding of Titan’s properties. The mission was considered an overall success, revealing a rich atmosphere, an icy surface, the likelihood of an underground ocean, and, most importantly, sparking the interest of scientists in its resemblance to a very young Earth.

    Bibliography (APA)

    Barnett, A. (Ed.). (2024, November 3). Cassini. NASA. https://science.nasa.gov/mission/cassini/spacecraft/huygens-probe/

    Barnett, A. (Ed.). (2024, November 5). Cassini at Titan. NASA. https://science.nasa.gov/mission/cassini/science/titan/

    Barnett, A. (Ed.). (2025, April 25). Titan Facts. NASA. https://science.nasa.gov/saturn/moons/titan/facts/

    Brown, M. J. I. (2022, December 7). Why doesn’t the International Space Station run out of air? Australia Broadcasting Corporation. https://www.abc.net.au/education/why-the-international-space-station-does-not-run-out-of-air/13928762

    Madani, D. (2023, June 28). Astronauts’ urine and sweat are almost entirely recycled into drinking water with new system. NBC News. https://www.nbcnews.com/science/space/astronauts-urine-sweat-almost-entirely-recycled-drinking-water-new-sys-rcna91619

    Ridgeway, B. (Ed.). (2025, April 4). Environmental Control and Life Support System (ECLSS). NASA. https://www.nasa.gov/reference/environmental-control-and-life-support-systems-eclss/

    US Energy Information Administration. (2023, December 26). Hydrocarbon gas liquids explained. US Energy Information Administration. https://www.eia.gov/energyexplained/hydrocarbon-gas-liquids/

    No AI was used in the writing of this post

  • Photo of Lego bricks

    https://www.ebay.ca/itm/284319734604

    Fusion Robotics Showcase

    Physical Prototype

    Arduino Code

    #include <Servo.h>
    
    int red = 9;
    int yellow = 8;
    int green = 7;
    
    Servo signServo;
    
    int servoPin = 13;
    
    void setup(){
      
      pinMode(red, OUTPUT);
      pinMode(yellow, OUTPUT);
      pinMode(green,  OUTPUT);
      
      signServo.attach(servoPin);
      signServo.write(0);
      
    }
    void loop(){
    digitalWrite(red, HIGH);
     delay(3000);
    digitalWrite(red,  LOW);
    signServo.write(180);
      
      digitalWrite(yellow, HIGH);
    delay(1000);
      digitalWrite(yellow,  LOW);
    delay(500);
      
    digitalWrite(green, HIGH);
    delay(2000);
    digitalWrite(green,  LOW);
    signServo.write(0);
      
    digitalWrite(yellow, HIGH);
    delay(1000);
      digitalWrite(yellow,  LOW);
    delay(500);
      
    }

    For my robotics assignment, I decided to create a simple traffic light mechanism. I chose to keep this project simple due to my limited prior experience in robotics, and specifically Arduino. To provide an overview, this mechanism utilizes three LED lights to represent the red, yellow, and green lights in a traffic light. The LEDs are controlled by a timer, which triggers the swap of the active LED at the appropriate time. A mechanism rotates to change the sign from “Go” to “Stop” whenever the active LED changes.

    This circuit schematic demonstrates how the Arduino circuit actually functions. To start, the Arduino UNO acts as the brain of the circuit, and controls which LED is turned on at which time and when the servo motor moves. Specifically, the Arduino UNO is the power source of the circuit, providing power to the lights and motor and storing the uploaded code. Next, the LEDs are split into 3 colours: green, yellow, and red. Each of these LEDs have two pins that conduct power from pins D7, D8, and D9 on the Arduino. The LEDs are connected to a resistor, marked by R2 on the right, with a resistance of 1k Ohms to limit the current flowing from the Arduino pins and prevent overloading the circuit.

    Following this, the Servo Motor (Stop & Go Sign) has three ports, each with a unique purpose, that receive power from the Arduino to rotate a small motor, which swaps the signs. As indicated by the wires, the power port connects to the 5 Volts output on the Arduino, which gives the servo the electricity needed to function. The GND port connects to the Ground, which completes the circuit so the current can flow properly. Lastly, the SIG port connects to the signal, which allows the Arduino to send instructions from the code to the servo, allowing it to rotate at the appropriate time.

    Attached above is the Bill of Materials for my traffic light project. The Arduino UNO R3 is the model of the actual Arduino circuit board. The LEDs, combined with the resistor, act as the traffic lights. The Positional Micro Servo indicates a motor that rotates based on given positions, rather than in continuous motion. Aside from this, female-male and male-male wires, as well as a breadboard, are needed to create the design.

    #include <Servo.h>
    // import the servo motor library
    
    int red = 9;
    int yellow = 8;
    int green = 7;
    // define which pins on the Arduino each LED is connected to.
    // set the variable values to "Integers" to accommodate the Arduino pins.
    
    // lines 1-8

    The code for this project is relatively simple due to the repeated use of similar commands. To start, the #include <Servo.h> imports a special library into the code that allows the Arduino to control the servo motors with many pre-set functions with parameters. Next, 3 variables are defined for the 3 LED traffic lights. The values of the variables determine which pins on the Arduino the LEDs are connected to.”int” restricts the variables’ defined values to integers to accommodate the integer numbers on the pins on the Arduino board.

    Servo signServo;
    // Connects the servo motor to the Arduino board and allow the Arduino to send commands to the motor.
    
    int servoPin = 13;
    // Define the Arduino pin the servo motor is connected to.
    
    // Lines 10-14

    Following this, a servo object is created using the imported “Servo.h” library. “Servo” prepares a servo object to be used from this library, while the “signServo” function gives this object a name. Because the servo motor is physically connected to the Arduino board, this function acts like a remote control that allows the Arduino to send commands to the servo. Similar to the LEDs, the “int servoPin” defines which Arduino pin the servo will draw power from.

    void setup(){
    // Prepare the LEDs and servo motor for use.
      
      pinMode(red, OUTPUT);
      pinMode(yellow, OUTPUT);
      pinMode(green,  OUTPUT);
    // Tells the Arduino that the LEDs will output power
      
      signServo.attach(servoPin);
    // Connects the previously defined servo to the defined pin (13).
      signServo.write(0);
    // Set the servo to its original position.
      
    }
    
    // Lines 16-29

    Moving on to the setup function, the main purpose of this portion of the code is to prepare the LEDs and the servo for use, which will be defined in the next few lines. Firstly, the “void” command tells the Arduino code that the following function will not return a result, as it will instead direct power to the LED pins. The “pinMode(colour, OUTPUT)” tells the Arduino that the LED pins are sending power out. The “signServo.attach(servoPin);” connects the previously prepared servo to the “servoPin”, which was defined as pin 13 on the physical Arduino. Finally, the “signServo.write” function sets the position of the servo motor to 0 degrees (starting position).

    void loop(){
    // Creates a forever loop
    digitalWrite(red, HIGH);
    // Determines whether when an LED needs to be active, and setting its power to high to turn it on.
     delay(5000);
    // Causes the above LED to stay on for 5 seconds before changing.
    digitalWrite(red, LOW);
    // Turns the active LED off.
    signServo.write(180);
    // Turns the servo 180 degrees, flipping it from its starting position to display a new sign.
    
    }
    
    // Lines 31-40

    To end, the loop function, without any parameters, keeps the rotation between the green, yellow, and red lights running forever. The “digitalWrite” function sets the power of the LEDs. In the showcased example, the red LED starts at a high power, turning it on. The “delay” function, counted in milliseconds, ensures that this function runs for 5 seconds before switching the red LED’s power to low, turning it off. Following this, the servo’s position is updated to 180 degrees, effectively flipping it from its starting position to display a new sign. This code is repeated for each of the 3 LEDs, and restarts at the end due to the forever loop.

    Showcasing the physical model, a key difference in circuitry I noticed between it and the virtual prototype was that multiple wires could be connected to a single port on the virtual version. For instance, the power for the LEDs and the Servo Motors could be directly attached to the 5V output on the Arduino Board, whereas on the physical model, I had to find a workaround by connecting the 5V pin to a single line on the breadboard, before attaching the LED and servo wires to that line.

    Despite this, I found that the process of making my physical prototype was an overall success, as it was easier than expected to connect each wire to the correct port, to upload the code to the Arduino, to find the correct parts, etc. In the end, I decided against attaching a Stop/Go sign to my servo motor so as to not damage the motor, but I am content understanding that the design functions properly.

    AI Transcript

    Below is a transcript of my AI usage. Because of my limited prior experience using Arduino in robotics, my main purpose for the use of AI was to learn the foundations of Arduino components and their specific coding language. I found that ChatGPT was the most suitable tool for this as it is able to explain complicated functions in simple terms, as well as with the help of useful analogies.

  • Photo of Lego bricks

    https://www.ebay.ca/itm/284319734604

    Fusion CAD Showcase

    Project showcase
    Mechanical Drawing & Bill of Materials

    For my Fusion CAD assignment, I designed a pot that could hold various types of houseplants. To showcase my idea, I created a cactus and a small Christmas tree to accommodate the pot. I created this design in OnShape as a model and blueprint for a 3D printed project.

    The visible part of the design is the tree, while the attachment stub at the bottom would fit into the pot. Because I am relatively new to CAD, I chose this design to effectively refine three main skills.

    Firstly, I chose to design interchangeable plants for the pot as it would test my skills to measure and assess the correct dimensions for each part to ensure it would fit with the pot’s hole and scale. Secondly, I chose to create a round cactus and a layered tree to demonstrate my ability to sketch complicated drawings and to make use of different methods of realizing sketches, such as with revolving and extruding. Lastly, designing these lego-like structures allowed me to practice with assembling detached parts.

    The overall process of creating this project can be divided into 3 main sections. The most important part of this design is the initial sketches. This sketch not only presents the shape of the plants and pot, but also maps out their dimensions to ensure each part connects with one another. The showcased example is a front-view sketch of the Christmas tree. On the bottom of the sketch, I decided to create an attachment block of standard dimensions (19 mm x 20 mm) that would fit into my pot hole. Each of the Christmas tree’s layers decrease by width incrementally, while maintaining a constant height. This helps to create symmetry in my design and ensures that the dimensions of the project would be easy to replicate by others viewing the mechanical drawing.

    The next step of the project is to realize these sketches. This would be accomplished with two main tools, revolve and extrude. The revolve tool allows a user to select an axis from their sketch and create a 3D model by rotating the 2D sketch around the selected axis, until either it meets itself to create a ring shape or the user stops the revolve to create a shape similar to a slice of pie. This tool is helpful for designing circular models, such as in this case for the body of the cactus.

    The second tool is to extrude the sketch, which creates a 3D model by extending a selected sketch with material to the front or back. This tool is especially useful for adding layers to a set sketch. This tool was used to create the attachment units connected to each plant. This second step creates 3D models for the sketches that can then be placed in assembly to review how each part interacts with one another. This interaction can be created using mates that connect the parts together, and can be seen in the mechanical drawings, as well as in the image below.

    Lastly, a mechanical drawing and bill of materials are included. This drawing essentially builds a blueprint for the project. The purpose of a mechanical drawing is to allow others viewing the project to understand and be able to replicate the design, with the correct dimensions and scale. I decided to include the top, front, bottom, and isometric view for all 3 parts of my project.

    The bill of materials serve a similar purpose, allowing a user to understand which materials they would need to replicate my design. Because I created the blueprint for a 3D printed project, my material only includes plastic filament of a specified type (PLA).

    Ultimately, by combining my skills in sketching, extruding & revolving, assembly, and creating a mechanical drawing with a bill of materials, I was able to create a simple houseplant CAD design.

    AI Usage Transcript

    Attached below is a transcript of my AI usage. I did my best to understand each component of the AI’s suggestions and incorporate them into my designs.

  • Photo of Lego bricks

    https://www.ebay.ca/itm/284319734604

    Fusion Coding Showcase

    Code:

    Below is my full code, along with a video run-through of it.

    ### system setup ###
    import pygame
    # import pygame from Google Colab's storage into this project
    import sys
    # import "System", which allows interactions with the Python code itself and lets it access other modules such as pygame
    import random
    pygame.init()
    # calls on the pygame module, as it's a function and prepares it to be used (similar to turning on a game console)
    
    
    ### game setup ###
    SCREEN_WIDTH = 1000
    SCREEN_HEIGHT = 500
    # setting up variables for determining the display size.
    # programming convention to use all caps for variables that will not change throughout the game
    screen = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT))
    # pygame function that sets up a display based on given width and height in the parameters
    clock = pygame.time.Clock()
    # creates a clock in pygame, which will be used to set up the frame rate of the game
    SPAWNPIPE = pygame.USEREVENT
    # creates a special event, which will be used to create and delete pipes in intervals
    pygame.time.set_timer(SPAWNPIPE, 600)
    # Spawns a new pipe once every 1200 miliseconds (1.2 seconds)
    score = 0
    font = pygame.font.Font(None, 50)
    # Simple scoring system based on survival time. In the parameters, "none" defines the default font, while "50" defines the font size
    
    ### game sprites ###
    ### bird ###
    class Bird(pygame.sprite.Sprite):
        # creates a python class, which is used to define attributes of a sprite. The parameter inherits existing attribute definitions and features from pygame
        def __init__(self):
            # function where all the attributes of the bird sprite will be defined
            super().__init__()
            # call on the above-mentioned function to begin prepare for defining the attributes
    
            self.image = pygame.Surface((30, 30))
            # Create a blank surface for the circle (bird)
            self.image.fill((142, 184, 250))
            # Make the surface transparent
            pygame.draw.circle(self.image, (255, 255, 255), (15, 15), 15)
            # Draw a white circle with the defined attributes
    
            # to upload an image as the sprite for the bird
            self.rect = self.image.get_rect(center=(100, SCREEN_HEIGHT / 2))
            # short for rectangle, function that defines the position and size of the bird, can be used as a hitbox
            self.gravity = 0.25
            self.velocity = 0
            # defines the bird's weight and speed (at the start of the game)
        def update(self):
            # function to update the bird's position on the display every frame
            self.velocity += self.gravity
            # as the bird's gravity increases, its speed/velocity will increase with it
            self.rect.y += self.velocity
            # when the velocity is positive, the bird will be falling (negative change in y), and vice versa for negative velocity
            if self.rect.top < 0:
                self.rect.top = 0
                self.velocity = 0
            if self.rect.bottom > SCREEN_HEIGHT:
                self.rect.bottom = SCREEN_HEIGHT
                self.velocity = 0
            # ensures the bird does not fly off the screen. If its y position matches the top or bottom boundaries, the bird's velocity will be set to 0
    
        def flap(self):
            self.velocity = -4
            # When the bird flaps, the velocity will be set to negative, shooting the bird's y position up against gravity
    
    # Create the bird
    bird_group = pygame.sprite.GroupSingle()
    # Creates a group that holds one sprite
    bird = Bird()
    bird_group.add(bird)
    # adds the bird to the group
    
    
    ### pipes ###
    class Pipe(pygame.sprite.Sprite):
        # similar to creating the bird sprite, with the difference that this sprite needs to ensure random spawn positions
        def __init__(self, x, y, position):
        # defines the x and y locations for the pipe, with the position parameter to determine whether the pipe is on the top or bottom
            super().__init__()
            self.image = pygame.Surface((50, 500))
            # creates a base for the sprite
            self.image.fill((0, 128, 0))
            # creates the pipe with the defined color
    
            # Determine the pipe's position and orientation
            self.rect = self.image.get_rect(midtop=(x, y))
            # short for rectangle, defines the dimensions and locations of the pipes. Get rect creates a rectangle the same size as the pipe
            if position == 'bottom':
                self.rect = self.image.get_rect(midtop=(x, y))
            # sets the middle-top of the pipe as the official "connecting point", aka the point the x and y locations will apply to
            if position == 'top':
                self.image = pygame.transform.flip(self.image, False, True)
                # Flips the top pipe vertically on the x-axis and creates a new sprite/pipe/rectangle in that new location
                # Ensures the top and bottom pipes are lined up
                self.rect = self.image.get_rect(midbottom=(x, y))
                # Changes the connecting point to the middle-bottom point of the rectangle to mirror the top pipe.
    
        def update(self):
            self.rect.x -= 6
            # Each frame move the pipe to the left by 3
    
    # Create the pipes
    pipe_group = pygame.sprite.Group()
    
    running = True
    while running:
        # Creates an infinite loop, as the while function requires a condition to be true to run, and "running" is currently set to true.
        # The code below will be repeated until running becomes false (when the player decides to quit)
        for event in pygame.event.get():
            # the "pygame.event.get" function collects all the user's actions during the loop, which lasts forever because of the while statement
            # used here to check for specific player inputs, but mainly closing the window
            if event.type == pygame.QUIT:
                running = False
            # if the user exits the window, the "running" variable will be set to false, stopping the while loop
            if event.type == pygame.KEYDOWN:
                if event.key == pygame.K_SPACE:
                    bird.flap()
            # similar function to the first "event.type", checks if user performs an action.
            # If space bar is clicked, the flap function is called to set the bird's velocity to negative, launching it upwards
            if event.type == SPAWNPIPE:
                pipe_gap = 150
                # the gap between the two pipes that the bird can pass through
                pipe_y_pos = random.randint(150, 350)
                # random y position chosen by the random integer function. this position is the middle of the gap of the top and bottom pipes
                bottom_pipe = Pipe(SCREEN_WIDTH, pipe_y_pos + pipe_gap / 2, 'bottom')
                # the bottom pipe's parameters are defined. The x-axis is fixed, so set to screen width
                # the y-axis is random, thus uses the random integer function as the parameter. because this is the center point of the gap,
                # half of the total pipe gap is added to the y position to push the pipe down, creating a gap for the bird to fly through
                pipe_group.add(bottom_pipe)
                # add pipe to bottom pipe group
                # Create the top pipe
                top_pipe = Pipe(SCREEN_WIDTH, pipe_y_pos - pipe_gap / 2, 'top')
                pipe_group.add(top_pipe)
                # same logic as the bottom pipe, but inverse, and the pipe is added to the top_pipe group
    
        clock.tick(120)
        # calling on a function that determines the frame rate of a game. It is set to 120 fps for best tested performance
        screen.fill((142, 184, 250))
        # creates a background with a light blue color
        score = pygame.time.get_ticks() // 1000
        # built-in pygame timer. The // is used to divide the ticks by 1000 and provide an integer answer for easier display
        bird_group.draw(screen)
        # This draws the bird on the display
        bird_group.update()
        # Updates the bird on the display each frame
        pipe_group.draw(screen)
        pipe_group.update()
        # same as drawing the bird, displays the pipes on the screen and updates it each frame
        score_text = font.render(str(score), True, (0, 0, 0))
        # Drawing the text on the screen, and the str converts the score (which was an integer because of the "tick" function) to a string for pygame
        # the antialiasing and color defines the text attributes, specifically to make it look more natural and to define its color
        score_rect = score_text.get_rect(center=(SCREEN_WIDTH / 2, 50))
        # Creates a rectangle with the rect function for positioning the score
        screen.blit(score_text, score_rect)
        # overlays the one sprite on top of another, in this case being score on top of the rectangle that contains it
        if pygame.sprite.spritecollide(bird_group.sprite, pipe_group, False):
            running = False
            # built-in pygame function that checks for collision between the bird and the pipe group
            # If the collision happens, running is set to false, stopping the while loop
    
        pygame.display.flip()
        # A function that changes the front buffer with the back buffer.
        # Games prevent screen flicker by using a "front buffer" for the current display the user sees, and an invisible "back buffer" for drawing the next frame.
        # Once the back buffer is finished, it is moved to the front by the "flip" function, ensuring smooth visuals
    
    
    
    pygame.quit()
    sys.exit()
    # quit pygame

    For my Fusion coding project, I created a Flappy Bird game using Python and the PyGame library. I chose this project because it is simple yet effectively demonstrates the required learning objectives, such as conditional statements (e.g., checking for spacebar inputs), the use of functions (e.g., bird physics, pipe generation), and making use of additional python libraries

    I chose to create my coding project on PyCharm, as it is a tool specialized for Python coding, which was my chosen language. I first imported the necessary tools to my project, including “PyGame”, whose library included many built-in functions helpful to creating 2D games. Next, I imported “Random” as that would be core to creating pipes at different positions each time for my game. Lastly, importing the system allowed the python code (the file I was working in) to actually interact with the imported modules.

    import pygame
    import sys
    import random
    pygame.init()
    # Calls on the PyGame library to prepare it for use
    
    (Lines 1-8)

    Next, I decided to build the game setup. The main use of this section was to set a few foundations which my game would be built upon. Notably, variables such as Screen_Width & Height determined the size of my canvas. With preset boundaries, these values could later be called on to position new sprites (such as the pipes).

    SCREEN_WIDTH = 1000
    SCREEN_HEIGHT = 500
    
    (Lines 12-13)

    The purposes of other variables, such as “clock”, “SpawnPipe”, “timer”, and “font-size” are self-explanatory. The game development is split into three main sections. Firstly, this “Game Set-up” section establishes the rules and the game environment before the actual gameplay loop begins. In short, it sets up variables that the later sections can call back on.

    The next section of my code is the sprite creation. The main purpose of this section is to define how my game will look, which in this case is the flappy bird’s and the pipes’ dimensions and attributes. This section was a little complicated to code, but simple to explain. The first step was to define a sprite, before determining its dimensions and properties, and lastly considering whether it needed additional functions and if so, how it would affect the game logic later on.

    self.image = pygame.Surface((30, 30))
           # Create a blank surface for the circle (bird)
           self.image.fill((142, 184, 250))
           # Make the surface transparent
           pygame.draw.circle(self.image, (255, 255, 255), (15, 15), 15)
           # Draw a white circle with the defined attributes
           # to upload an image as the sprite for the bird
           self.rect = self.image.get_rect(center=(100, SCREEN_HEIGHT / 2))
           # short for rectangle, function that defines the position and size of the bird, can be used as a hitbox
    
    (Lines 37-46)

    Lines like this, for example, create attributes for “self” (the bird) by setting a foundation, drawing a sprite on top of that, and adding an invisible rectangle beneath it to decide the bird’s position. Other lines such as gravity and velocity affect the physics of the game.

    The last part of the code defines the central game logic. The most important line, the “While” loop, creates an infinite loop that ensures the game is updated each frame, so that the game functions smoothly internally and externally.

    running = True
    while running:
       # Creates an infinite loop, as the while function requires a condition to be true to run, and "running" is currently set to true.
       # The code below will be repeated until running becomes false (when the player decides to quit or loses)
       for event in pygame.event.get():
           # the "pygame.event.get" function collects all the user's actions during the loop, which lasts forever because of the while statement
           # used here to check for specific player inputs, but mainly closing the window
           if event.type == pygame.QUIT:
               running = False
    
    (Lines 108-116)

    Lines such as “for event in pygame.event.get():” collect all of the user’s actions while the game is running. Specific actions from this collection, mainly space bar clicks and ending the game, are then checked by codes such as “if event.type == blank”. If the condition is satisfied, then the following function would be performed. Aside from the major game logic, this section also facilitates minor but important parts of the game. For example, setting a background refreshes each frame and determining the fps of the game. The code ends with the functions “pygame.quit()” and “sys.exit()”

    Ultimately, by combining setup, sprite design, and game logic, I believe I learned some of the necessary skills to build a complete and functional Flappy Bird game.

    Gemini Usage Transcript

    Below is the transcript of my AI usage. Although I experienced troubles in making AI provide lessons on how the code worked instead of writing it out for me, I’ve put in my best effort to understand each line. I have written comments in nearly every line of my code, explaining its function and purpose in the context, and I hope this demonstrates my comprehension. Alongside this, I have made edits to the code to alter its attributes as a way to show I understand the logic behind it.