All Posts

MIDTERM: Progress

PROJECT PROPOSAL

A 2-player maze chase game built on p5.js. Players are each assigned a role, the hunter and the prey. The maze is set in the nighttime, meaning that neither the prey nor the target can see the full maze. Each player is equipped with a flashlight, which spotlights them and allows them to see some surroundings. Prey’s goal is to escape the maze before the hunter chases them. Hunter’s goal is to catch the prey before they escape from the maze. Prey’s flashlight is stronger and hence allows us to see more of the maze because I feel like their goal may be more challenging to fulfill.

BIGGEST CHALLENGE

I identify my biggest challenge for this project as the building of the maze itself. I have the hardest time understanding the logic behind the building of anything that uses grids. Besides that, I have minimal knowledge of algorithms that allow for maze generation. To help myself with that, I will refer to the multi-part youtube tutorial by The Coding Train, in which they create a maze generator using a depth-first search algorithm with recursive backtracking. I have also found this page useful in introducing myself to the pros and cons of different maze-building algorithms.

IMPLEMENTATION

I decided to start by addressing my biggest concern for this project, which is adding a self-generating maze. The tutorial that I have referred to uses a randomized depth-first search. After looking through other possible algorithms, I have settled on Kruskal’s algorithm, which generates more dead ends in the maze. So far, the code that I have generates a maze with one player and one maze exit. The player can move around the maze using WASD for controls. The maze exit doesn’t do anything yet.

THINGS TO WORK ON

Basically everything else (e.g. sound, player sprites, spotlight, intro window, player interaction, etc). As for the maze, I need to add another player to it, and possibly control the position of the maze exit so that it is closer to the “prey” than to the hunter. For now, it is pretty easy to get from the start to the end of the maze even with all of the dead ends. However, I think that the difficulty of the game won’t be a question once I have the spotlight feature implemented.

 

Midterm Project

Concept

I recently made a website whose theme is based on galaxies and its accompanying features. ie Gravity, rotation about a center etc. I draw inspiration from that idea to create a shooting game, one that obviously features a protagonist’s spaceship shooting enemies.

Resources: https://drive.google.com/drive/folders/1XpSZpyi1ZLYHNcuS6oSnQvXkh0091LMh?usp=sharing

I anticipate adding a feature that will animated ellipses that imitate the movement of stars in the galaxy; so far, I think that is the task that may prove difficult.

Week 5: Midterm progress

For this midterm project, I decided to create a computer modification of a Ping Pong game. In this game, the two players control the two paddles on either side of the game window. They move the paddles up or down to hit the moving ball. The score of a player increases when he/she hits the ball.

Game features:

  • Player must bounce the ball in order to score points
  • Each player will have a paddle and an individual score counter
  • Players can move the paddle only vertically (along the initially specified y-axis)
  • Paddles will be in rectangular shape, the disc will be in circular shape
  • The control key for the player 1 will be “W” and “S” keys, for the player 2 – “UP” and “DOWN” keys

 

The Most Complex Part:

The most complex  and time-consuming part of this project was writing the code for checking the collision the paddle with the disk and making it bounce off as in the real life. In order to achieve this goal, I decided to rely on the physic’s law of collision: when the disk hits the surface, it will bounce with the same speed as before in the opposite direction(conservation of impulse) and it will also bounce off with the same angle (angle of incidence = angle of reflection). After a few trials and error , I succeeded in implementing this collision check and bouncing correctly.

The below code is where I implemented this logical check:

//Code for managing Disk movement               
Disk_movement(){ 
    this.disk_xc = this.disk_xc + this.disk_speed_x
    this.disk_yc = this.disk_yc + this.disk_speed_y
}

//Code for managing Disk bouncing when it touches boundaries 
 Disk_bouncing(){

  
    //Code for bouncing off if disk hits the boundaries
    //this if statement will be executed if the disk touches right-side boundaries of the table
    if(this.disk_xc + this.disk_w/2 > RES_W){
      
      this.disk_speed_x = - this.disk_speed_x
    }
            
     //this if statement will be executed if the disk touches left-side boundaries of the table       
    else if(this.disk_xc - this.disk_w/2 < 0){
      
      this.disk_speed_x = - this.disk_speed_x
                 
    }
   
    //this if statement will be executed if the disk touches upper or lower boundaries of the table
    if(this.disk_yc + this.disk_h/2 > RES_H || this.disk_yc - this.disk_h/2 < 0){
        if(RES_H/2 + 100 < this.disk_yc  || this.disk_yc < RES_H/2 - 100){
            this.disk_speed_y = - this.disk_speed_y
        }
      
    }
 
    this.disk_xc = this.disk_xc + this.disk_speed_x
    this.disk_yc = this.disk_yc + this.disk_speed_y            
 }
                    

 

Future Improvements:

I still don’t have images and sounds, so I will work on integrating them to this game. Apart from the background music, I also want to add a collision sound for when the disk hits the paddle.  In addition, I’m still working on adding the restart feature to the game, and I also want to make this game consist of several rounds.

 

 

Midterm Progress “The Martian”

Concept & Design

For this Midterm Project I would like to create a game using everything I have learned so far in class. The game will be called “The Martian” and the objective of the game is to guide the Mars Rover through the treacherous terrain of Mars, collecting valuable resources and avoiding hostile alien spaceships and rocks on the surface. The player will have to navigate using keyboard and mouse as they progress through the game. In “The Martian” the player will experience the thrill of driving a Mars Rover on the surface of the red planet. With challenging terrain, hostile aliens, and valuable resources to collect, the game will offer hours of exciting gameplay. The use of p5.js will enable the creation of a visually stunning and engaging game.

Potential Design Elements

Complex part of midterm project

For me personally the most frightening  or complex part of this midterm project is to implement a collision detection algorithm. The idea is to detect the collision between Mars Rover and other objects like valuable resources and hostile alien spaceships or rocks. I also have to somehow come up with an algorithm to distinguish between these various collisions with different objects. Because if the Mars Rover collides with valuable resources the Score should increase and if it collides with the rock or alien spaceship it should end the game and display the restart button. Also because I didn’t have any previous background in using sound and animation libraries I would have to test them out.

Implementation & Reducing the risk

Here I wrote some code for the collision algorithm between Mars Rover and Rock:

if(ufo$.isTouching(rover)||stone.isTouching(rover)) {
            console.log("end");
            state="end";
            ufo$.destroyEach();
            stone.x=width+400;
            stone.velocityX=0;
            rover.visible=false;

            gmov.play();
               
            textSize(30);
            textFont(font);
            fill("black");
            text("The End",width/2,height/2);
        }

        if(mousePressedOver(switchBtn)) {
            sd=1;
            click.play();
        }
        if(sd==1) {
            state="pause";
        }

I also tried to implement the spawn of Alien Spaceships:

function spawnEnemy() {
    ufo=createSprite(width+50,Math.round(random(xp-100,xp+20)),80,80);
    ufo.velocityX=-5;
    ufo.addAnimation("ufo",ufo_);
    ufo.scale=0.2;
    ufo.lifetime=Math.round(width/3)+15;

    //ufo.debug=true;

    ufo.setCollider("circle",0,0,200);

    ufo$.add(ufo);
    console.log(xp);
    cx-=4;
}

 

Midterm Progress | Survive the Semester

Concept

For the midterm, I want to develop a simple game “Survive the semester”. In this game, a player should catch different items to continue playing until time is over. In case time reaches 0, the player won. For now, my plan is to make game over in cases when player’s health or joy levels reaches 0. I intend to include 2 progress bars reflecting student’s health and joy. Different items will have different effects on the bars, e.g. catching sleep will increase player’s health. Though, the game logic is not yet finalized. I may do it the way that if student fails to catch something, health/joy is deducted.

Design

I chose the NYUAD night picture as a background image. I am a kind of student who does a lot of study-related work at nights, so this choice was a bit relevant to me to reflect the game theme on studying.

Implementation

For me, the most frightening part was to get an idea of what game I want to develop. I would not describe myself as creative, and creating original game takes a lot of effort and time to me. I was also concerned on the progress bars and updates to them. I did not finish their implementation now, but I got the idea on how to work on them and I believe I should be able to finish it well before submitting my work.

I have also implemented the main mechanical part of game – involving falling ball and catching figure. I will  change the image of falling objects and catching rectangle to adjust to my game design objectives. I kept it simple for now to test if it works as it should first.

Future Steps:

I got a lot of ideas on my mind and I am excited to see on what I will end up implemented for this game!

Yet, what I would definitely need to add to my implementation:

  • Sounds. Should be fun experience to select those =)
  • More images. Especially, for falling objects. Falling ball is irrelevant to my game now.
  • OOP. It should not be a problem.
  • Better visuals involving text. Now it is basic, I may need to make the visual part of game provide better UI and UX to the player
  • More enhanced game logic and progress bars!

Link to the sketch: https://editor.p5js.org/ds6058/sketches/1lbHkjJpV

 

 

 

Midterm Proposal

My idea for my midterm project is to develop a variation of the classic brick breaker game. Instead of breaking bricks, the objective of the game is to prevent the ball from dropping from the bottom of the screen. The game will feature various items that the ball can hit that the player must navigate to keep the ball in play.

One of the unique features of the game is that hitting an obstacle can affect the gameplay in various ways. For example, if the ball hits a “sizing” obstacle, the size of the bar at the bottom of the screen may increase or decrease. Another obstacle could change the speed of the ball, making it either faster or slower. Some obstacles may be stationary, while others may move back and forth, making it more challenging to keep the ball in play.

The game will have different levels, and as the player progresses through the levels, the game’s difficulty will increase, requiring the player to react quickly and adapt to the changing gameplay.

I will get a better understanding of the complexity of the game once I start coding it but some of the challenge I believe I could possibly run into are the following:

– One of the most crucial aspects of the game is the collision detection between the ball and the obstacles. I will need to create an algorithm that can detect when the ball hits an obstacle and determine the correct response, such as changing the bar size or ball speed.
– Integrating a continuous scrolling background in the game to add a dynamic and immersive element to the gameplay experience. I have looked into some code examples that I could use for this.
– Finding the right balance between challenging and enjoyable gameplay. For this I will need to playtest the game extensively to ensure that it provides enough challenge to keep the player engaged, but not too much to become frustrating.

ASSIGNMENT 5- MIDTERM PROJECT PROGRESS

IDEA

For my midterm project, I decided to create a game out of the options from which we could choose any to create a project. A game that would use all the concepts learned in class so far. I got my inspiration from a game on the apple app store called “Hit the Island”. I always wondered how the game was created and how the developers got it to be interactive with the dynamic island on the iPhone 14 pro series. After taking this class, I have gained enough knowledge to know that the game doesn’t actually interact with the dynamic island but has a bar-shaped object behind the island with which the balls in the game interact.

ORIGINAL GAME

 

The original game below was developed by Funn Media, LLLC.

UI DESIGN

This is the basic form which i want my game to take. On a surface level, the game basically consists of a paddle, a ball and another paddle on top of the screen which i call the island. In the game, the paddle is controlled using the left and right arrow keys. Every time the ball hits the island, the user gains a point. The game ends when the balls fall off the screen.  The game has three different pages. The intro page, the game page and the end page. In the intro page, the user has the option to start the game or quit the game. In the end page or game-over page, which shows after the user has lost the game, the user has the option to restart the game or quit as well.

PROGRESS SO FAR

So far, I have the basic game page set up with the balls and the user-paddle. I also have placeholders( which are basic color backgrounds ) set in place for the intro page and the end page which i am yet to design in either photoshop or illustrator.

 

CHALLENGES SO FAR AND INTENDED UPDATE

I haven’t encountered any major challenges so far. This is my progress as at now and in the final version of my game, i intend to to have two paddles, the moveable one which i have now and a static one (the island) at the top of the screen just as the original game. Every time the ball hits the paddles, there will be a sound feedback to improve the overall experience of the game. There will also be a background sound and an option for the user to mute the sound in the game or to keep it playing.

Midterm Project Progress – Aigerim

Concept

For my midterm project, I want to do a cute little game where the user gets to play around on the beach as a cat. Initially, I wanted the game to be about a turtle that lays eggs on the beach because I go on turtle nest patrols on Saadiyat as a volunteer and it is one of the most exciting activities I get to do in spring. Sadly, it was impossible to find a sprite sheet and terrain elements of the aesthetic style I am going for, and I had to swap the main character from a turtle to a cat. The game is essentially a cat simulator on the beach, where the player gets to feed, play with the cat and explore the beach.

Aesthetics/Resources

All of the images used in this game are from the following website: https://opengameart.org/users/bluecarrot16

I always find picking the overall theme of the project to be the most difficult part, which is why I spent a lot of time looking for the fitting terrain, beach elements, and sprite. At the moment I am using the following images to build the game terrain:

Implementation

At the moment, I have elements of the starting screen where the user gets to pick what cat they want to be: when a mouse hovers over a certain cat it moves up and down. As I mentioned earlier, the most time-consuming part of this project is getting these images and cropping them in a way that I can use them in arrays. For example, to get these cats on the screen () I had to crop the big picture into smaller parts that are of uniform size and spaced out evenly.  Once I am done with preparing the images, coding the program should not be a challenge.

Future Plans

  • Add beach elements like palm trees, ponds, seashells, etc that the cat can interact with
  • Add cat “status” of its needs that need to be fulfilled in the game (if not fulfilled the cat dies 🙁 )

These are the basic required functionalities of the game, however, there is a lot more that I wish to implement like making the game multiplayer, adding new characters (birds) that I have the resources for in terms of spritesheets. Whether they will come to life or not will depend on the time restrictions, but I am very excited to see how this project will turn out in the end!

 

 

 

Midterm Project: Initial Documentation

Concept & Design

As part of my Mid term project, the idea is to create a game that is similar to the traditional ‘space-ship’ games, combined with the ‘infinite-runner’ game ideology. This would essentially be a canvas, where a rocket starts from the bottom, has freedom to move around, with the background moving, depicting a running environment. The objective would be for the rocket to dodge some meteors falling from the sky, and also to fuel up with cans that become available in intervals.

The graphical objects that I gathered so far are:

Code Structure & Progress

The code structure is intended to be Object Oriented and Modular. As of right now, I have a canvas with a background that repeats itself smoothly and a Rocket that moves around the canvas, wraps around the sides.

The Asteroids will be made to ‘spawn’ with time, and then as soon as they exit the screen, they will be respawned from the top end of the screen again.

Complexity

There will be more clarity of the complexity as I start running into issues, however, the primary objective of mine is to provide controls to the rocket such that it is rotatable. I will have to use mathematical calculations with the ‘right’ and ‘left’ keys to ensure the rocket does not flip its image to the right and left directions, instead it bends at an angle as the right and left keys are pressed. This is a functionality that I shall experiment and figure out!

Another functionality that I envision to add is local storage on the Chrome Browser to keep track of a ‘score’, and record the highest score. Only the highest score shall be saved per device.

Midterm Project #1: Progress Report

Concept:

For my midterm project, I was inspired by some of the mini-games in Five Nights at Freddys: https://www.youtube.com/watch?v=HB8iVkfWlBU.

Especially the balloon-boy mini-game or Chica mini-game where essentially as the main character, you’re in a platform style game and you’re supposed to go around collecting balloons to give to the children throughout the game. I found it a pretty simple concept but very fun to play around with:

I obviously wanted my own design of the game but I had trouble thinking of what to do. But, I was watching one of my favourite animes One Piece and I thought why not just make a game about that! It’s a pretty cool idea and it’s pretty motivational for me so I went along with it!

My Game Idea:

The game idea is pretty cool. Essentially the main character of the series is a guy called Luffy, and he is known for always being hungry and eating everything he can possibly find. So, I decided to make a similar platform style game where Luffy would jump around eating as much food as possible.

To make it into a game, I thought of implementing a depleting hunger bar, and the goal is to keep feeding Luffy by jumping around and eating food before that hunger bar runs out and the only way to refill that hunger bar is to eat food. If you manage to satisfy Luffy’s hunger bar before time runs out, you win! Else you lose!

Progress:

With regards to my process, i’ve so far, made the main menu screen. This main menu screen has some music playing in the background, I added a slider so the user can control the volume. I added an instructions tab so the user knows how to play. I also added a difficulty system, where the user can select between Easy, Medium and Hard mode. The idea is, the greater the difficulty, the faster Luffy’s Hunger bar depletes, hence the more challenging it gets to satisfy Luffy’s hunger.

I’ve also set the stage for the platforms of the game and i’ve added an animation for the hunger bar depletion when the game starts. If the hunger bar reaches 0, for now it just says “Game Over”:

Game:

Things still left to do:

  • I have to create the food items and their specific data (this includes their spawn point, spawn rate and food value)
  • I have to animate Luffy’s movements (using a sprite sheet i’ve found on the internet)
  • I have to work on collision detection with Luffy and the Food objects and the Platform objects.
  • I have to ensure that when a collision is detected between Luffy and Food, it should refill the Hunger Bar
  • Add a time countdown
  • Create an ending screen (depending on whether the user wins/loses)
  • Allow the user to restart or go back to the Main Menu.

Terrifying parts of the code:

In my opinion, I think the most terrifying bit is going to be two things, animating Luffy’s movements, being both left and right and especially the jumping animation. The issue with this is, if you press both the LEFT and UP arrow keys together, they don’t move the object diagonally because it registers as one key pressed at a time, so to handle smooth movement is going to be tricky. I’m thinking to avoid this I might have to ensure the platforms are close enough for the user to maneuver across the game.

Also animating Luffy’s jump is going to be extremely tricky. For this, I am thinking of creating a sort of gravity variable, which will allow Luffy to move up a maximum distance when pressed the UP Arrow key and then after that, he would move down in the opposite direction. Still need to do some thinking for that.

Finally, another tricky thing would be collision detection. I’m wondering how to ensure that Luffy can stand on the platforms. For now, i’ve set up a class for Platforms and a class for Luffy and if their x and y coordinates are the same, then Luffy can stand on the platforms. Still need to do some more thinking of that.

Overall:

Overall, I feel like this can be a really cool game. The easy bit is kinda done but the challenging bits are here and I’ll work hard to ensure the game is great!