This is a C++ OOP project using Qt to build a Mario game.
Introduction to Computer Science 2 lectured by Prof. Yean-Ru Chen, in 2024 NCKUEE.
- 蔡承希:30% (Mainwindow Functions, Floor Brick, Mario Basic Functions, Flag & Flag Pole, GameOver Animation and Restart button, Compilation)
- 蔡辰鑫:30% ( Mario running and jumping action, Super mushroom, fire flower, bullet)
- 黃士洵:40% ( Floor Brick, Stone Brick, Normal Brick, Broken Brick, Box Brick, Water Pipe, Invisible Brick, Coin, Toxic Mushroom, Reset Objects for Restart, Map Designing )
The game's final goal is to control Mario to capture the flag at the end of right side.
- If the following happens, the game is over and will reset the game :
- Mario fall to the bottom of the hole, you Lose.
- Mario lose all HP, you Lose.
- Mario reach the flag with less than 21 coins ( score ), you Lose.
- Mario reach the flag wiht more than 20 coins ( score ), you Win.
Mario has 3 HP at most
- If Mario touch a super mushroom, HP increases 1 and turn bigger size.
- If Mario touch a toxic mushroom, HP decreases 1 and turn smaller size if he was in bigger size before.
You can control Mario by pressing the following keys on the keyboard.
- 'w' : Jump
- Note : Double jump ( jump again while not grounded ) is not permitted.
- 'a' : Move Left
- 'd' : Move Right
Mario can fire 3 bullets with mouse, only after he gets a fire flower.
If a toxic mushroom is shot by the bullet, it will die immediately.
There are several bricks with different characteristics.
- Floor brick : only appear on the ground, without speicific funtion.
- Stone brick : a brick without specific function.
- Broken brick : when being touched from below, the brick will break and disappear.
- Normal brick : when being touched from below, either nothing happen or Mario gets a coin. However, it will turn to a Stone brick after Mario get 5 coins from it.
- Box brick : when being touched from below, the brick will randomly generate a coin or a super mushroom or a fire flower and then transform into a Stone brick.
- Water pipe : a huge brick without specifix function.
There are several items with different characteristics. Item will disappear after begin touched by Mario.
- Super mushroom : will moving around or fall to ground. When Mario touch it, Mario Increase 1 HP and turn into bigger size if he was in smaller size before.
- Fire flower : when Mario gets it, he can shoot 3 bullets.
- Coin : when Mario gets 1 coin, the score increases 1.
- Flag : when Mario touches the flag pole, the flag will fall down. Then, when Mario touches the flag, game overs.
There is only 1 kind of enemy.
- Toxic Mushroom :
- will moving around or fall to ground. When Mario touch it, Mario Decrease 1 Hp and turn into smaller size if he was in bigger size. Meanwhile, if Mario still has left bullets, all of them will be removed!
- To kill the Toxic Mushroom, Mario can either jump on its head or use bullets to shoot them.
- When Mario touches a particular Toxic Mushroom, he will get an independent immune time (2s) for that Toxic Mushroom.
- In the game folder ( /game/ ) , use the following command :
$ make
$ ./Project1_v2
Notice : If you are using Cygwin, you should open another terminal and input:
$ startxwin
then back to the initial terminal and input:
$ export DISPLAY=:0.0
before you actually run the executable file.
What requirements and bonus we had done and implement in this project.
- Game Rules
- Player (Mario)
- Jump with Gravity
- Size
- Bullet
- HP
- Score
- Bricks
- Floor Brick
- Stone Brick
- Normal Brick
- Broken Brick
- Box Brick
- Water Pipe
- Items
- Super Mushroom
- Coin
- Fire Flower
- Flag & Flag Pole
- Toxic Mushroom
- Background
- Frame Movement
- Bricks
- Invisible Brick