Skip to content

patriciafiona/Comprehensive-Programming-Final-Projects

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Comprehensive Programming Final Projects

Figure 1 Preview of Flappy Bird Game


Result of Flappy Bird Porting Game Project, requirement for pass Comprehensive Programming Class in Nanjing Xiaozhuang University. Developed using C++ and Python.

Information

Figure 2 Flappy Bird Logo

Projects Name         : Flappy Bird

Creator               : Patricia Fiona - 王佳佳

Student ID            : L20253009

Type                  : Final Project (Nanjing Xiaozhuang University)

Platform              : PC

Programming Language  : [C++](https://isocpp.org/) & [Python](https://www.python.org/)

Disclaimer            : This projects is only for study purpose only!

Project Running Preparation

A. SFML

Here I using Visual Studio 2019 for running the C++ project with SFML. The steps that you must prepare for running this project are:

  1. First, you must download the SFML SDK from the download page. You can then unpack the SFML archive wherever you like.
  2. Open the C++ game project in Visual Studio
  3. Open project properties by right click in the project name

Figure 3 Open Properties by Right Click in the Project Name

  1. In the project's properties, add:

    • The path to the SFML headers (/include) to C/C++ » General » Additional Include Directories
    • The path to the SFML libraries (/lib) to Linker » General » Additional Library Directories

    These paths are the same in both Debug and Release configuration, so you can set them globally for your project ("All configurations").

    Figure 4 Set the SFML include Location

    Figure 5 Set the SFML lib Location

  2. The next step is to link your application to the SFML libraries (.lib files) that your code will need. SFML is made of 5 modules (system, window, graphics, network and audio), and there's one library for each of them.

Libraries must be added in the project's properties, in Linker » Input » Additional Dependencies. Add all the SFML libraries that you need, for example "sfml-graphics.lib", "sfml-window.lib" and "sfml-system.lib".

In this project we will add this libraries:

  • sfml-graphics-d.lib
  • sfml-window-d.lib
  • sfml-system-d.lib
  • sfml-network-d.lib
  • sfml-audio-d.lib

Figure 6 Set the SFML lib that We want to Use

  1. Because here I use dynamic version of SFML, we can save the setting by click Apply and Ok.
-More Details about the setting can be seen in SFML Official Website (https://www.sfml-dev.org/tutorials/2.5/start-vc.php)-
  1. Now you can run the game

B. Python Environment

Here I use conda environment that use Anaconda App to create python game environment. If you don't have Anaconda App, you can still prepare the environment by using the steps that you can search by yourself and make sure that you already have Python in your computer. The process of preparing the enviroment can be seen in the bottom instructions:

  1. Open Anaconda Prompt
  2. To create an environment:
conda create --name {NAME_OF_YOUR_ENVIRONMENT} python=3.8

For Example:

Figure 7 Create Python Environment with Conda

  1. Activate your Environment by running this code:
conda activate {NAME_OF_YOUR_ENVIRONMENT}

Figure 8 Activate Conda Environment

  1. Install PyGame in your environment by running this code:
pip install pygame 
              OR
conda install -c cogsci pygame 

Figure 9 Install PyGame Library in Environment

  1. You can check your list of libraries by running this code:
pip list

Figure 10 Checking List of Libraries in Environment

  1. Open the Python Project in Visual Studio

  2. Choose the Environment by choose Add Environment

Figure 11 Add Python Environment in Visual Studio 2019

  1. Select 'Existing Environment' ->>> From the Environment section, select 'Your Envirnoment' ->>> And Click Add

Figure 12 Add your Environment to the Project

  1. Now you can run the game

Results for App

Action Result Action Result
C++ Preview Python Preview

Releases

No releases published

Packages

No packages published

Languages