Giter VIP home page Giter VIP logo

ncursespong's Introduction

ncurses-pong

Simple pong game developed in C using the ncurses library.

Documentation

The goal of this project was to create a simple pong game in C using a pseudo-object-oriented design. The game doesn't function entirely like a regular pong game due to the reduced resolution of the display-grid.

Here are some design decisions that were made in order to make the game playable in a reduced resolution environment:

  • When the ball hits the board it bounces off in a random direction in order to avoid infinite loops
  • The AI is simplified, i.e. it isn't perfect in order to make the game a bit funner (a perfect AI was boring to play against)
  • The AI can only see two frames into the future
  • The game pauses for a second when a point is scored in order to show that the score was updated
  • The screen size is fixed to the initial size of the terminal it was launched in (not adaptable)

Class diagram

Here is a figure describing the general structure of the program:
Class diagram of the pong game_logic

Note that the project was initially designed to run on a Cyclone V SoC board, whose architecture was cut out from the diagram.

Running the game

Since the game was developed in C, you will need to have gcc and ncurses installed on your machine (both usually come packaged with most Linux distributions). Once that is assured you can run the game simply with the following commands:

cd src  
make game   
./game   

ncursespong's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.