Code Monkey home page Code Monkey logo

glade2d's People

Contributors

ctacke avatar kalldrexx avatar profexorgeek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

glade2d's Issues

Write docs for new Layer system

I need to document what Layers are and how to use them. Raw notes from chat w/ @KallDrexx:

Layer

  • Composite sprite.
  • Drawn once to a buffer.
  • Can be "scrolled" which will wrap pixels in X and Y dimensions.
  • Can track a camera offset for when camera is implemented
    • Don't really understand this yet
  • Layers can support transparency but are faster if it doesn't.
  • Layers have their own transparency color setting
    • TransparentColor: the color to consider transparent when drawing sprites TO this layer
    • BackgroundColor: the color to fill the layer background with. This should be the same as the transparent color if you want transparency
  • Call "Shift" on layers to shift by a certain velocity to get parallax scrolling effect. This is usually done in the tick/update/activity method
  • Sprite rendering happens over the top of layers just like simple rendering

LayerManager

  • Add layers to the LayerManager to have them show up in the screen
  • Cannot set layer index to 0 because this is the sprite layer
  • Sprites can only be drawn at layer index 0 and be sandwiched betweeen layers
  • Layer manager controls rendering.
  • Currently must unload layers when unloading screen

TextureManager

  • Split out loading/unloading and dealing with texture manager
  • TextureManager was created to make this code more reusable
  • May eventually become a broader ContentManager

Glade should have a process for unloading screens

Screens currently have no unloading process to dispose of textures, sprites, layers, etc.

  • Glade should be updated so that screens have an unloading process.
  • The base Screen class should have a virtual unload method
  • Sprites should be recursively unloaded and destroyed on unload
  • As part of unloading the LayerManager should clear any layers

Saw the devcamp demo, and I was wondering...

Hi, I was wondering if any of the XNA code was useful as a reference. This was Microsoft's indie game platform, 10 + years ago. .net based. I see the archive is on GitHub https://github.com/SimonDarksideJ/XNAGameStudio

That also points to monogame https://github.com/MonoGame/MonoGame and a number of ports, such as fna.

P.s. Add the #meadow tag to the repository, and check out some of my meadow demos, like expressivepixels, fontdemo, meadowlife, digitalrain, and meadow invaders

Proposal: Sprite Groups

Today in Glade, each sprite has to be manually managed by the developer. When sprites are related to each other, and should have the same physics, collision detection, and positioning rules applied to them

A concrete example of this is space invaders. In the game you have X rows and Y columns of enemies that all move in the same direction and at the same speed. They change animation frames at the exact same time. They change direction whenever the outer ones hit the screen boundary, only one enemy on the bottom row fires at a time, and generally it's impossible for a player's shot to collide with an inside enemy before hitting an outside enemy.

Many NES games had larger bosses that were made up of multiple sprites combined together as well (though I don't have good examples offhand).

It seems like this can be made easier on developers with the concept of sprite groups, akin to entities in FRB. This provides a central type that developers can inherit from to provide functionality to a group of sprites. The developer can then just add the whole sprite group to the screen to add it to the screen graph.

Sprite groups can be optionally rendered to a custom render target, which allows special cases where the whole group of sprites only has to be rendered once instead of every frame.

Performance: Render Layering

This is a container to hold a conversation that started on slack in a more public and discoverable place.

Problem: Rendering transparency is expensive and slow.

Concept: We should have a background layer that's flattened and fast, and a foreground layer that has transparency. This keeps calls that don't need transparency quick.

Ideas from chat with Adrian

  • Use 565 buffers throughout (device native)
  • Scale textures on load because buffer copies will be faster than the final scale
  • Figure out how to accommodate a lower bit buffer (1bpp?) without rewriting an interim buffer for every display depth

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.