2021 Fall Comp2012h Final Project. A Plant-Vs-Zombie style desktop game with beautiful graphics and sound effects. Developer: thomas914, mitester and tiliuau.

Overview

Underperforming Students vs Teachers

Table of Contents

Authors

  • Tim, TSE Wai Chung
  • Thomas, LI Ka Chun
  • Blaise, LIU Tianmiao

Code Conventions

  • DO NOT write function definitions in header files, since the complier will not check mistakes.
  • Use Camel Case to name functions and variables.
  • All decimal variables should be stored in double type.
  • Please use /* I am some detailed description */ to describe the class at the top of the header files
  • Please write comment //i am a very readable comment (such that other people can understand your code).
  • Use MIL (Member Initialization List) in class constructors.
  • When creating new class in Qt, please: (Especially when the class makes use of signal and slot)
    • Make sure the class inherits from QObject
    • Check the option Add Q_Object
  • For any resource needed for this program, please use Qt Resource File(.qrc file)

Workflow

  1. All tasks are listed in issue section.
  2. Take tasks in issue by yourself.
  3. Feel free to add issues to issue.
  4. Create your own branch to commit your work. Name your branch as [your github username]-patch.
  5. Please send a pull request from your branch into main as long as you think your code you're working on should be well-known by everyone
    • This pull request should be approved by all participants before you merge.
  6. Please fetch updates from main every time using GitHub Desktop before you start working locally.

Class Structure

+-- QObject
|   +-- QWidget
|       +-- QLabel
|           +-- ClickableLabel
|               +-- SpriteCard
|   +-- TimeVariant
|       +-- Human
|           +-- Student
|               +-- AttackStudent
|                   +-- SleepDeprivedStudent
|                   +-- DeadlineFighter
|                   +-- CgaGod
|               +-- SupportStudent
|                   +-- ShamelessStudent
|                   +-- TeachersPet
|                   +-- GbusStudent
|           +-- Teacher
|               +-- OverworkedTA
|               +-- Kelvin
|               +-- Pang
|               +-- Desmond
|       +-- Item
|           +-- Redbull
|           +-- Assignment
|           +-- VendingMachine
|   +-- Game
|   +-- Row

THE END

Issues
  • Issue: getType() function for Students

    Issue: getType() function for Students

    Also a problem was encountered in implementing teacher's attack function.

    In short, teacher needs to know the type of student when attacking them to perform appropriate reactions. For example, after attacking a teacher's pet, the attacker needs to turn around. This can be implemented only when the teacher has a way to know the type of the student being attacked.

    My proposed solution is to add a getType() function to students. Any other solutions are also welcomed.

    enhancement help wanted code 
    opened by mitester 8
  • Discussion: about the Behavior of Teachers Being Attacked

    Discussion: about the Behavior of Teachers Being Attacked

    Proposing two ways

    • Copying from PVZ
      • Teachers will be temporarily turned red after being attacked and gradually fall down when they died.
    • A new way
      • Keep temporarily turning red and exploded when they died, or some fire would come out. I don't know. haha

    @mitester @tliuau What do you guys prefer? New ways are also welcomed.

    enhancement help wanted question mechanism 
    opened by thomas914 6
  • Issue: All accessors/mutators of students are protected

    Issue: All accessors/mutators of students are protected

    When implementing the attack function of teachers, I found that all accessors/mutators are protected. All other classes can never access or change the fields of student. This causes problems. For example, when a teacher attacks a student, it needs to get and set that student's hp to a lower value.

    question code 
    opened by mitester 5
  • Discussion: Some Suggestions on 'const'

    Discussion: Some Suggestions on 'const'

    I think that all of the 'get' functions should be added with the keyword 'const', e.g. "int getHp() const;" for better security. So does for pointer parameters.

    code 
    opened by mitester 5
  • Issue: about the Inconsistent Variable Names between Student Class and Teacher Class

    Issue: about the Inconsistent Variable Names between Student Class and Teacher Class

    I took a glance at the code related to Teachers. However, I found that the naming of different game quantities is inconsistent between Student and Teacher. They are listed below,

    • atk and damage
    • speed and skillSpeed

    For the sake of consistency and clear interpretation, damage and skillSpeed are proposed. Only these two inconsistent names are discovered up to now. Please state them out if more are found.

    question code 
    opened by thomas914 3
  • Sprite Placement System, UI Design and Redbull System

    Sprite Placement System, UI Design and Redbull System

    • Sprite selection board
    • SpriteCard class
    • Adjusted distances and size of vending machine
    • Rewrite mousePressEvent
    • Sprite Placement and linkage with redbull system
    • No sprite is allowed to be placed to the right of any Teacher
    • First playable version
    opened by mitester 2
  • Thomas914 patch

    Thomas914 patch

    I failed to follow the constant values naming convention before while naming those default constant parameters for every class. Now corrections have been made. New variable names are as follows,

    • DEFAULT_NAME
    • DEFAULT_MAX_HP
    • DEFAULT_SKILL_SPEED
    • DEFAULT_COST
    • DEFAULT_DAMAGE
    opened by thomas914 2
  • Issue: Game Mechanism Design

    Issue: Game Mechanism Design

    A discussion thread for game mechanism design issues, including:

    • The timing mechanism
    • Interaction between objects
    • Philosophy of class design
    • Redbull System
    • Terminate Condition
    • Map and UI placement

    Feel free to add more content. The conclusion will be made a file for record.

    documentation mechanism 
    opened by mitester 2
  • Update on Row

    Update on Row

    Major updates:

    • Row now uses QVector to maintain Teachers, instead of priority_queue
    • class Game added new static const field MAX

    Rationale: Teachers have different speeds. Their relative distance/order may change during the game. Hence the priority structure maintained in priority_queue will be disturbed. QVector is used now to avoid this problem. Some memorization techniques are applied to make the access faster.

    bug code 
    opened by mitester 1
  • Notice: Current Classes Layout is not Fulfilling the Signals & Slots Requirements Provided by Qt

    Notice: Current Classes Layout is not Fulfilling the Signals & Slots Requirements Provided by Qt

    @mitester Please be well-known

    Any class that wants to use signals & slots mechanisms must obey all the rules listed below:

    • Inherits from QObject
    • Include the macro Q_OBJECT in the first line of the class. (Be above any accessors)

    I have already polished the code so that they are fulfilling this. I'll push them and send a pull request to the main branch later.

    Moreover, it is proposed to tick the Q_OBJECT and Inherits from QObject options while creating a class that would use signals & slots on the Class Creation Wizard.

    Also, if you add the two conditions manually, compilers would potentially err undefined reference to vtable for classname as it is a ~~bug~~ feature. If so, you may refer to https://blog.csdn.net/shine_journey/article/details/73741207

    Close this issue if you understand.

    bug help wanted code 
    opened by thomas914 1
  • Question: about attack() Function Prototype

    Question: about attack() Function Prototype

    the corresponding function prototype is virtual void attack(Student& s);

    I am wondering why the parameter type is Student& since you will be able to change the value of s. It is far more than changing its properties. So I think Student is enough.

    question code 
    opened by thomas914 1
Owner
Computer Science Student, HKUST
null
This command-line tool converts an FM broadcast signal into stereo sound with de-emphasis applied.

stereodemux This command-line tool converts an FM broadcast signal into stereo sound with de-emphasis applied. It expects 16-bit signed-integer MPX (F

Oona Räisänen 9 Jun 11, 2022
A C, C++ and Rust library to draw graphics with pixels in the terminal

A library to draw graphics with pixels in the terminal Who needs a GUI when you have a terminal ? Building To generate libpluto.a, run: $ make To ins

null 67 Jun 15, 2022
📺🗿 Terminal graphics for the 21st century.

???? Chafa is a command-line utility that converts all kinds of images, including animated GIFs, into sixel or ANSI/Unicode character output that can be displayed in a terminal.

Hans Petter Jansson 1.4k Jun 24, 2022
nicegraf-shaderc is a command-line tool that transforms HLSL code into shaders for various graphics APIs.

User Manual Table of Contents Introduction Project Status Obtaining the Source Code and Building Running Defining Techniques Generated Header File Pip

nicebyte 88 Jun 20, 2022
0day VirtualBox 6.1.2 Escape for RealWorld CTF 2020/2021

RWCTF21-VirtualBox-61-escape 0day VirtualBox 6.1 Escape for RealWorld CTF 2020/2021 Demo What? This is our solution for RealWorld CTF's "Box Escape" c

null 121 Jun 9, 2022
Advent-of-Code: 2021 Edition

?? ?? Advent of Code 2021 ☃️ ❄️ Description Advent of code 2021 Awesome Advent of Code Advent of Code is an Advent calendar of small programming puzzl

Lento Manickathan 6 Apr 5, 2022
Simple Unix Terminal Football Manager-like game.

Superleage 2020/2021 It is a "work in progress" simple game based on some mechanics of Football Manager. The game is in a very early stage of Developm

sewe2000 2 Oct 14, 2021
game-tools est un petit module C++ contenant des sous-programmes utiles pour développer des petits jeux s'exécutant dans un terminal.

game-tools est un petit module C++ contenant des sous-programmes utiles pour développer des petits jeux s'exécutant dans un terminal. Ce module met à disposition des fonctionnalités simples permettant d'effacer le terminal, de mettre le programme en pause, d'afficher des éléments en couleur ou encore de générer un nombre entier aléatoire.

Tom Planche 4 Mar 1, 2022
CLI to play a word-guessing game like Wordle

Lexeme What is this? Python program to play a word-guessing game like Wordle, but… More addictive because you can play it over and over and over, not

Dan Lenski 6 Feb 7, 2022
A CLI based solver for the popular word guessing game WORDLE

Project WAR WAR stands for Wordle Answer and Resolver About Wordle is a web-based word game developed by Welsh-born software engineer Josh Wardle, for

Yeluri Ketan 2 Feb 19, 2022
Tutored programming project for the first semester of my DUT in computer science

Pac-Man Project Description First of all, this game has been realized in binomial as part of our first programming tutorial project of our first year

Arthur Pellegrini 1 Nov 5, 2021
This repository contains the source code of the project(StereoCraft) that we have developed for the Mixed Reality Hackathon organized by Microsoft using StereoKit SDK

StereoCraft - A block-building like experience built using StereoKit This repository contains the source code of the project that we have developed fo

G Bhanuteja 2 Dec 23, 2021
A program to help simplify the process of setting up Kirby Hats for EX Characters in Project+Ex builds.

lavaKirbyHatManager A program to help simplify the process of setting up Kirby Hats for EX Characters in Project+Ex builds, based on DesiacX's EX Kirb

null 3 Jun 18, 2022
A small self-contained alternative to readline and libedit that supports UTF-8 and Windows and is BSD licensed.

Linenoise Next Generation A small, portable GNU readline replacement for Linux, Windows and MacOS which is capable of handling UTF-8 characters. Unlik

ArangoDB 334 Jun 5, 2022
A readline and libedit replacement that supports UTF-8, syntax highlighting, hints and Windows and is BSD licensed.

Read Evaluate Print Loop ++ A small, portable GNU readline replacement for Linux, Windows and MacOS which is capable of handling UTF-8 characters. Unl

Marcin Konarski 572 Jun 27, 2022
A simple header-only C++ argument parser library. Supposed to be flexible and powerful, and attempts to be compatible with the functionality of the Python standard argparse library (though not necessarily the API).

args Note that this library is essentially in maintenance mode. I haven't had the time to work on it or give it the love that it deserves. I'm not add

Taylor C. Richberger 981 Jun 23, 2022
CLI11 is a command line parser for C++11 and beyond that provides a rich feature set with a simple and intuitive interface.

CLI11: Command line parser for C++11 What's new • Documentation • API Reference CLI11 is a command line parser for C++11 and beyond that provides a ri

null 2.1k Jun 24, 2022
A (relatively) small node library to clone and pull git repositories in a standalone manner thanks to libgit2, powered by WebAssembly and Emscripten

simple-git-wasm A (relatively) small node library to clone and pull git repositories in a standalone manner thanks to libgit2, powered by WebAssembly

Powercord 20 May 20, 2022
A simple header-only C++ argument parser library. Supposed to be flexible and powerful, and attempts to be compatible with the functionality of the Python standard argparse library (though not necessarily the API).

args Note that this library is essentially in maintenance mode. I haven't had the time to work on it or give it the love that it deserves. I'm not add

Taylor C. Richberger 896 Aug 31, 2021