Code Monkey home page Code Monkey logo

portal-2d's Introduction

Portal 2D

A 2D version of Valve's Portal developed in C++ with SFML. Uses a custom game engine written from scratch. Still very much in the early stages.

Features

  • Uses a custom component-based game engine modelled on Unity
  • You can create custom level files and have them be imported
  • You can move a player around a level
  • Collision between the player and structures works in general

To-Do

  • Set up some actual gameplay mechanics
    • Portals
    • Cubes
    • Turrets
  • Non-placeholder art
  • Menus
  • UI

Development Setup

Dependencies

Setup

  • Install all the dependencies
  • Pull the repo
  • Open portal-2D.sln
  • Right click on the portal-2D project and select Properties
  • Edit the properties dealing with external libraries to point at your installations of the third party libraries
    • In particular, you'll need to edit at least the Additional Include Directories and Additional Library Directories settings
  • Build and run

portal-2d's People

Contributors

atjallen avatar

Watchers

 avatar

portal-2d's Issues

Better raycast algorithm

At the moment the raycasting algorithm is super slow. Need to research and implement a better algorithm.

Proper engine configuration

Since the engine is a separate thing now. Need a way to configure it properly when using it as a library. Presumably this would be something like being able to pass a configuration file/object to it and perhaps even set individual configuration options at a later time.

Tile Amalgamation

Currently levels produced by the level loader create an individual tile object for each tile in the level file. This could theoretically slow down the game in levels with a lot of tiles. Probably a good idea to implement some sort of tile amalgamation for same tiles.

Extend `sf::Vector2<T>`

Currently, utility functions for SFML vectors like length, normalize, etc. are implemented as pure functions which take vectors as arguments. It may be a better idea to create a child class of sf::Vector2<T> and implement these as member functions of that class.

Merge `GameObjectManager` and `Engine`?

There doesn't seem to be much reason to have these as separate classes (other than messiness) since there can only really be a single game object manager and the engine implements a bunch of wrapper functions for the manager anyway.

Use tags instead of separate game object types

Currently a lot of different structure types (Wall, Ceiling, Floor) are separate game object types in code. It may be more practical to make this a common type like Structure and then use tags instead to denote their role.

Proper hierarchy

At the moment, game objects can be connected but there is no hierarchy between them (e.g. the player is connected to the portal gun but the portal gun is not a 'child' of the player, it's transform is not influenced by the player's, etc.). It might be worthwhile implementing a properly hierarchical structure. However, this is likely to be very challenging and time-consuming.

Better way to connect components?

ATM components are connected via the createComponent() function and references to them are stored in each gameobject. Is there perhaps a better way to connect these? Perhaps just storing components directly on the gameobject?

Tidy up FPS counter

Make the FPS counter look a little bit nicer and add an option to enable/disable it in the engine.

Scrub font history

I accidentally committed a copyrighted font (๐Ÿ˜ฌ) which will need to be scrubbed from the history at some point.

Portals

Now that we have a portal gun and a ray, we need to actually make portals!

Non-relative Includes

ATM all includes are relative (e.g. "../../foo"). I believe best practice is to make these absolute but I'm not quite sure how right now. I probably have to change something in Visual Studio.

Return `const sf::Vector2<T>&`

At the moment I'm returning just sf::Vector2<T> which is creating a potentially unnecessary copy every time. Returning a const reference will enable the option of not making a copy if need be.

Engine namespace

If the idea is for the engine to become an independent library at some point, it will need its own namespace.

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.