Skip to content

dangtiendung1201/Cataurant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🐈Cataurant🐈

Actions Status Actions Status Actions Status

This is my own game project using C, C++ and SDL2 libraries at University of Engineering and Technology, Vietnam National University.

Table of Contents

Information

Name: Đặng Tiến Dũng
Student ID: 22026523
Class: K67J
Email: dangtiendung1201@gmail.com
Facebook: fb.com/dangtiendung1201

Idea

From mini-game called Comfy Cakes in Purple Place (Info, Demo) included with Windows 7 operating systems, I create a new game with the same logic1. Instead of a "conveyor belt" in the original game, I use a "deque" to manage "burger ingredients". "Requests" are shown as "customers", ... and many changes. Threfore, my game is just about 10% similar to the original game.

I chose this game because I want to challenge myself with a new game that requires a lot of thinking in design and implement. I also want to create a game that is not too simple and not too complicated, so that I can play it in my free time.

Milestone

  • 08/03/2023: Have ideas about the game.

  • 12/03/2023: Initialize all SDL libraries + Implement and refactor some SDL utilities.

  • 14/03/2023: Finish game menu.

  • 15/03/2023: Add some features in menu.

  • 16/03/2023: Show game background.

  • 17/03/2023: Make first game character move.

  • 22/03/2023: Make more game characters.

  • 25/03/2023: Render more characters.

  • 06/04/2023: Implement burger ingredients.

  • 06/04/2023: Implement burger ingredients.

  • 08/04/2023: Release 1.0 version.

  • 17/04/2023: Realease 1.1 version.

  • 02/05/2023: Release 1.2 version.

  • Ongoing: Add Japanese, Russian and Vietnamse language using Unicode.

  • Future: Play via LAN using SDL2_net library.

  • Future: Using my own assets and change the LICENSE.

  • Future: Using Emscripten to play game in browser.

Prerequisites

All dependencies (for Windows only)2 are in bin, include, lib folders.

  • C, C++
  • SDL2, SDL2 image, SDL2 mixer, SDL2 ttf

Build

$\color{red}{\textrm{Note: Because of the differences in coding environments, Makefile provided below could not work.}}$ $\color{red}{\textrm{In this case, please contact me via email/facebook above or compile it yourself}}$

For Windows with 32 bit MinGW and equivalent

  • Clone the project
git clone https://github.com/dangtiendung1201/Cataurant.git
  • Create a Makefile at the root directory
OBJS = $(wildcard src/*.cpp)
OBJ_NAME = cataurant.exe
RESOURCES_SCRIPT = cataurant.rc
RESOURCES_FILE = cataurant.res
COMPILER_FLAGS = -std=c++17 -static-libgcc -static-libstdc++
LINKER_FLAGS = -lmingw32 -lSDL2main -lSDL2 -lSDL2_image -lSDL2_mixer -lSDL2_ttf
INCLUDE_DIR = -Iinclude/32bit
LIB_DIR = -Llib/32bit

compile:
	windres $(RESOURCES_SCRIPT) -O coff -o $(RESOURCES_FILE)
	g++ $(COMPILER_FLAGS) $(INCLUDE_DIR) $(LIB_DIR) $(OBJS) $(LINKER_FLAGS) -o $(OBJ_NAME) $(RESOURCES_FILE)
  • Compile by Makefile
make

For Windows with 64 bit MinGW and equivalent

  • Clone the project
git clone https://github.com/dangtiendung1201/Cataurant.git
  • Create a Makefile at the root directory
OBJS = $(wildcard src/*.cpp)
OBJ_NAME = cataurant.exe
RESOURCES_SCRIPT = cataurant.rc
RESOURCES_FILE = cataurant.res
COMPILER_FLAGS = -std=c++17 -static-libgcc -static-libstdc++
LINKER_FLAGS = -lmingw32 -lSDL2main -lSDL2 -lSDL2_image -lSDL2_mixer -lSDL2_ttf
INCLUDE_DIR = -Iinclude/64bit
LIB_DIR = -Llib/64bit

compile:
	windres $(RESOURCES_SCRIPT) -O coff -o $(RESOURCES_FILE)
	g++ $(COMPILER_FLAGS) $(INCLUDE_DIR) $(LIB_DIR) $(OBJS) $(LINKER_FLAGS) -o $(OBJ_NAME) $(RESOURCES_FILE)
  • Compile by Makefile
make

For MacOS

  • Clone the project
git clone https://github.com/dangtiendung1201/Cataurant.git
  • Install dependencies
brew install sdl2
brew install sdl2_image
brew install sdl2_ttf
brew install sdl2_mixer
  • Create a Makefile at the root directory
OBJS = $(wildcard src/*.cpp)
OBJ_NAME = cataurant.exe
COMPILER_FLAGS = -std=c++17
LINKER_FLAGS = -lSDL2 -lSDL2_image -lSDL2_mixer -lSDL2_ttf

compile:
	g++ $(COMPILER_FLAGS) $(OBJS) $(LINKER_FLAGS) -o $(OBJ_NAME)
  • Compile by Makefile
make

For Ubuntu and equivalent

git clone https://github.com/dangtiendung1201/Cataurant.git
  • Install dependencies
sudo apt-get update
sudo apt install libsdl2-dev
sudo apt install libsdl2-image-dev
sudo apt install libsdl2-ttf-dev
sudo apt install libsdl2-mixer-dev
  • Create a Makefile at the root directory
OBJS = $(wildcard src/*.cpp)
OBJ_NAME = cataurant.exe
COMPILER_FLAGS = -std=c++17 -static-libgcc -static-libstdc++
LINKER_FLAGS = -lSDL2 -lSDL2_image -lSDL2_mixer -lSDL2_ttf

compile:
	g++ $(COMPILER_FLAGS) $(OBJS) $(LINKER_FLAGS) -o $(OBJ_NAME)
  • Compile by Makefile
make

Run

$\color{red}{\textrm{Note: For Windows only, please add bin to Environment variable}}$

After building the project successfully, please run it.

.\cataurant

Gameplay

Objective

Your objective in this game is to serve your customers as quickly as possible, while also feeding hungry cat (bottom-left corner) if you want. You have 3 lives, so try to serve as many customers as possible without making mistakes.

Ingredients

There are 4 types of ingredients in the game: Bread, Meat, Tomato, Lettuce.

Seller

You are the seller (Doraemon) who will serve the customers. You can move left and right to serve customers. You can also control the deque of ingredients by using up and down arrow keys.

Customers

At the start of the game, customers will begin to appear at your stall with their requests. Each customer has a patience bar, which will decrease if you take too long to serve them. If a customer's patience bar runs out, they will leave and you will lose a life.

Hungry Cat

Hungry cat will appear at the bottom-left corner of the screen. You can feed him if you want. He may give you some bonuses randomly (play the game to find out them) after being feed.

Score

You will get score for each customer you serve. You will also get score for each customer you feed. The score will be displayed at the top-left corner of the screen.

Lives

Lives will be displayed at the top-right corner of the screen. You will lose when you run out of lives.

Controls

  • Left, Right arrow keys to move the seller (Doraemon).
  • Up, Down arrow keys to control the deque of ingredients.

Screenshots

Menu Game Lose

Demo

Link.

Credits

Special thanks to:

  • All teachers in course INT2215 1 - Advanced Programming for their enthusiasm and knowledge.
  • All my former Informatics teachers in Thai Binh Gifted High School and Thai Binh National Olympiad in Informatics Team for my knowledge in data structures and algorithms.
  • Lazy Foo' Productions for their tutorials on SDL2.
  • SDL2 for their library.
  • GitHub for powerful coding tools.

In this game, I used:

Notes

  • Technical notes: Link

Footnotes

  1. Assembling a cake to match a given cake specification.

  2. Please use sudo apt in Ubuntu or brew in MacOS to install packages.