yeahrb / yeah

Ruby video game framework
MIT License
464 stars 26 forks source link

Standard gameplay types #40

Open aostrega opened 10 years ago

aostrega commented 10 years ago

Yeah's purpose is to provide the most efficient interface to create games with, so it makes sense to provide gameplay abstractions based on common practices. Examples of other tools that provide gameplay abstractions are Game Maker, Unity and Phaser.

Commonly, a game engine has gameplay objects (which I'll call "things") and levels & other screens (which I'll call "scenes").

A scene contains things in space. On each frame, a scene iterates over active things to update them and once more to draw them. Scene drawing often involves a camera object. There are often multiple draw layers (e.g. background, thing, foreground, interface layers).

A thing is contained within a scene. On update, it can gather information about the game (e.g. player input) and scene (e.g. collisions with other things), and it is sometimes given the time elapsed between update calls; then it acts based on that. On draw, it can draw itself on the display.

The goal is to provide these abstractions out-of-the-box to minimize re-invention of the wheel and create a greater common ground for extensions, while making them flexible enough to be used/extended to recreate everyone's favorite games and making it simple to forego them altogether.