Giter VIP home page Giter VIP logo

asteroids's Introduction

Asteroids! - a Java asteroids implementation in OpenGL for Dave Straayer's
            CS142 class.

Design
Since there are a limited number of students with OpenGL experience, we have
kept all the OpenGL related code in two classes ScenePanel and Sprite.  We used
two other advanced concepts that we have not yet covered in class to keep the
code uncluttered. All the game entities (asteroids, the player's ship, bullets,
etc.) inherit from the Actor base class, and we store all the actors currently
in the game in a Vector so we can have a single code path to update, render,
and handle collision detection for all entities currently in play.

Classes
    Asteroids - contains static methods for the game logic
    Vector - Provides simple 2D vectors used for position and velocity.
    GUI - Provides the GUI window.
    ScenePanel - Provides the OpenGL canvas to display the game.
    Sprite - Provides a class that uses OpenGL textures as sprites for each
            game entity. It includes a number of static methods to
            load all the required textures and provide textures for
            each type of entity.
    Actor - the base class for game entities that will move around and be
            drawn on the screen. The following classes inherit
            from this class.
        Asteroid - the Asteroids in the game
        PlayerShip - the player's ship
        Bullet - a projectile shot by the player's ship.
        PowerUp - See Below
        Particle - See Below
    InputHandler - Handles Keyboard inputs.
    SoundEffect - Manages Sounds. E.G. SoundEffect.forPlayerDeath().play();
    Sound - Plays a wav or mp3 file in a new separate thread.
    ParticleSystem - Manages the particles in the game.
        Particle - While it is an Actor, its stored in the ParticleSystem.particles
                   Vector. This keeps them from being collision detected.
            FireParticle - A Particle class to simulate fire. Specifically player thrust.
            DebrisPartic - A Particle class to simulate asteroid debris
    Weapon - Class for the Weapon of the PlayerShip. Weapons implement shoot();
        BasicWeapon - The weapon that the player starts with. Shoots 1 shot at a time
        TripleShotWeapon - A player weapon that shoots 3 shots at a time.
    PowerUp - An Actor that represents a power up that the player can get by running over.
        TripleShotPowerUp - Replaces the player's ship's weapon with a TripleShotWeapon.

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.