Giter Club home page Giter Club logo

bkengine's Introduction

BKEngine

Build Status

bkengine's People

Contributors

akiwa avatar chrboe avatar skaupper avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

chrboe

bkengine's Issues

Implement generic interfaces

it should be possible to exchange e.g. the graphical functionality.
for this matter add at least a:

  • GraphicsInterface
  • SettingsInterface
  • AudioInterface
  • EventInterface

The graphics interface has major priority!
Also think of a way to pass all interfaces as a whole (InterfaceContainer?)

How are these interfaces to be initialized? Builder pattern??

Finish general Texture handling.

By now the communication between the ImageInterface, FontInterface and GraphicsInterface is not as good as it could be.

A general texture need further properties in order to be rendered properly (or just to add flexibility).
A texture needs at least:

  • a size
  • a position
  • a rotation angle
  • a boolean flag for flipping horizontally and vertically
    (add more if reasonable. nothing library specific!)

Also think about what the ImageInterface/FontInterface should return. Are own Texture derivates needed or suffices Texture?

Node: Sizes and positions are relative to the parent (the element's renderBox in this case). The angle should be in radians.

Implement the AnimationUtils class.

AnimationUtils should be responsible for:

  • adding textures
  • removing textures
  • retrieving textures
  • providing the texture count
  • setting the frames each texture get displayed
    (add more if reasonable)

The name of a texture should be used as identifier where needed (a name field may not exist yet...).

Provide an SDL GraphicsInterface.

Derive from GraphicsInterface and implement all functions using the SDL2 library.

If the interface need changes, implement them too.

Provide an SDL EventInterface.

The SDL EventInterface has already been implemented (legacy_snippets/) but it may not fit into the new structure.

Merge it back into our main workspace!

Implement the SceneUtils class.

SceneUtils should be responsible for:

  • adding elements
  • removing elements
  • retrieving elements
  • providing the element count
  • moving elements to different collision layers
    (add more if reasonable)

The name of an element should be used as identifier where needed.

Implement a caching mechanism for Images.

To avoid loading the same image again and again we need an image cache to store the resulting texture.

Should this be implemented directly in the ImageInterface?

Implement a caching mechanism for Fonts.

To avoid doing the same calculations again and again we need a caching algorithm for loaded Fonts AND rendered Textures.

Should this be implemented directly in the FontInterface?

Allow querying objects by name

By now objects can only be queried one layer at a time. This can result in frustrating and messy code.
To prevent that each object should be accessible from everywhere in the hierarchy. The new unique names should be of the following format:

<sceneName>[<typeID>].<elementName>[<typeID>].<animationName>[<typeID>]

To make this work naming should follow the same rules as variable naming does!
The optional typeIDs can be used to resolved ambiguity. Most of the time it won't be necessary but with elements containing child elements and animations in the future it will be helpful.

If possible try to implement the query methods to parse the string on compile time even if the format needs to be adapted!!

Implement the ElementUtils class.

ElementUtils should be responsible for:

  • adding animations
  • removing animations
  • retrieving animations
  • providing the animation count
  • "activating" an animation
    (add more if reasonable)

The name of a animation should be used as identifier where needed (a name field may not exist yet...).

Provide an SDL ImageInterface.

Derive from ImageInterface and implement all methods using SDL2_image.

If the interface does not suffice, change it and implement the changes in the structure too!

Implement the GameUtils class.

GameUtils should be responsible for:

  • adding scenes
  • removing scenes
  • retrieving scenes
  • providing the scene count
  • "activating" a scene
    (add more if reasonable)

The name of a scene should be used as identifier where needed.

Outsource hierarchical logic into a separate baseclass

Methods for adding, removing and querying children are identical for (most) core classes.
Create a base class with basic implementations for adding removing and querying (the querying methods should be stubs. that will be a separate ticket).

It should also be possible for inheriting classes to somehow modify the adding/removing process. Scenes for example need to add their elements to the right collision layer too!

Provide an SDL FontInterface.

Derive from FontInterface and implement all methods using SDL2_ttf.

If the interface does not suffice, change it and implement the changes in the structure too!

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.