Giter Site home page Giter Site logo

warandpeace's Introduction

WarAndPeace

cg2 Plane Fight game using OpenGL and C++. This is a simple game where the player has to shoot the opponent. There is also dual player mode. The animation of armstice is also done using OpenGL transformation functions.

Basic Controls

PLAYER 1

  • a - to move left
  • d - to move right
  • w/SPACE - to shoot
    PLAYER 2:
  • <- - to move left
  • -> - to move right
  • left mouse click - to shoot

Dependencies : freeglut, stb

For Fedora : yum install freeglut-devel

For Ubuntu : sudo apt install freeglut3 freeglut3-dev

cmd to build(for linux) : make -f Makefile

cmd to build(for windows): make -f makefile.win

Concepts used

  • Here I have used gluPerspective for the projection matrix which helps to see the near objects bigger and far objects smaller.

  • Terrain is implemented using GL_TRIANGLE_STRIP and choosing random z value for the appearance of uneven surface. Textures have been added for realistic view. To Load the image to texture stb_image library is used.

  • OpenGL timer functions are used to update the positions to the objects in the scene and to provide slow movement to the objects. The C++ STL i.e lists are used to store the co ordinates of the objects in the scene.

  • GLLight is used to give lighting and shading to the scene. By using lighting we can change the theme from day to night and vice versa. GL_AMBIENT, GL_SPECULAR and GL_DIFFUSE are used to set the type to material which behave differently to light.

  • freeglut is window creating library which is used to handle window related options. It is used to create menus, add KeyboardFunc and MouseFunc.

plane If you clicked War the above screen appears. You can right click to start the game.

cg5 This is the final scene.

warandpeace's People

Contributors

sharathbp avatar

Watchers

James Cloos 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.