Midterm Progress: Save Bran Stark!

Concept:

HBO’s Game of Thrones has countless iconic scenes that have been forever ingrained in the memory of 21st century pop culture, but arguably one of the most iconic and significant is the fall that crippled Bran Stark and set off the ripple of scandals that made the series’s plot as complicated as it is. While I obviously do not condone acts of violence against minors, I found the scene quite funny because of how absurd everything was: a 10 year old child who somehow managed to climb up the exterior of a tower accidentally witnesses an incestuous affair and then gets thrown out of a window. I figured that I would eternalize this scene in a more lighthearted way by creating a simple game in which multiple Brans will fall and the player, with their mouse, has to catch the boy by moving a pile of hay as a cushion for him to fall on. Each game will last 60 seconds, and players must save as many Brans as they can — and prevent the chaos that is about to spread throughout Westeros.

A rough sketch of what the game will look like.

Project Components:

  • OOP: Bran Stark will be a class. Bran’s sprite and the parameters for his falling movement will be set in this class.
  • Image: Using Procreate, I will illustrate a simple background image that depicts the tower from which Bran fell + grassy ground + pebbles. The sprite for Bran will also be illustrated by yours truly (in a desperate attempt to make up for amateur coding with good artistic direction).
  • Sound: I plan to have the show’s opening theme, composed by Ramin Djawadi, play as soon as the game loads; it will stop when the timer runs out and restart along with the game.
  • Text: The starting screen will show the game’s title in the same font as the show’s title card. The countdown and score will also be displayed.
  • Shape: I will draw simple shapes to serve as buttons for starting/restarting the game.

Code Progress:

  • So far, I have a rough sketch of red ellipses (placeholder for Bran) that fall at varying speeds and a yellow rectangle (placeholder for hay cushion) with a fixed y position that moves horizontally with the player’s mouse. Both of these are classes of their own.
  • The Game of Thrones main title theme starts playing when the game loads.
  • The checkCollision() function checks if a Bran has came into contact with the hay cushion; if so, the score increases by 1 and that specific Bran is removed while a new Bran spawns at the top.
  • let brans = [];
    let hay;
    let numberOfBran = 3; //number of Brans to be on screen at the same time
    let score = 0;
    let music;
    
    function preload() {
      music = loadSound("GOT Main Title.mp3");
    }
    function setup() {
      createCanvas(600, 400);
      for (let i = 0; i < numberOfBran; i++) {
        brans[i] = new Bran();
      }
      hay = new Hay();
      music.play();
    }
    
    function draw() {
      background("rgb(180,226,218)");
      //display Bran and hay cushion
      hay.display();
      for (let i = 0; i < brans.length; i++) {
        brans[i].display();
        brans[i].move();
        
        //increase score and reset Bran after collision
        if (checkCollision(brans[i], hay)) {
          score += 1;
          brans[i].reset();
        }
      }
      fill(0);
      text("Score:" + score, 500, 80);
    }
    
    //check for collision between Bran and hay cushion
    function checkCollision(bran, hay) {
      let d = dist(bran.x, bran.y, mouseX + 35, hay.y + 15); 
      return d < bran.diameter / 2;
    }
    
    class Bran {
      constructor() {
        this.x = random(50, 550);
        this.y = 0;
        this.speed = 3 + random(0, 7);
        this.diameter = 50;
      }
    
      display() {
        fill("rgb(216,78,78)");
        ellipse(this.x, this.y, this.diameter);
      }
    
      move() {
        this.y += this.speed;
        //re-generate Brans at top of screen when Brans fall off screen at the bottom
        if (this.y - this.diameter / 2 > canvas.height) {
          this.reset();
        }
      }
    
      reset() {
        this.x = random(50, 550);
        this.y = 0;
      }
    }
    
    class Hay {
      constructor() {
        this.x = mouseX;
        this.y = 330;
      }
    
      display() {
        fill("#FCD179");
        rect(mouseX, this.y, 70, 30);
      }
    }
  • Challenges:
  • Setting a countdown for the game would be a challenge for me, as I have never tried incorporating one into my projects prior to this one.
  • I will also need to figure out an algorithm that prevents the randomly generated positions of the falling Brans from overlapping.

 

Leave a Reply