gamez 0.0.2+4 copy "gamez: ^0.0.2+4" to clipboard
gamez: ^0.0.2+4 copied to clipboard

outdated

A small 2D game engine to easily create games in Flutter by providing different methods for rendering, gesture detection, etc.

GamEZ #

A small 2D game engine to easily create games in Flutter by providing different methods for rendering, gesture detection, etc.

Utilization #

Create the game model #

The game model is responsible for the logical part of the game, such as adding/removing entities and managing gestures.

class MyGame extends Game {
  // ... Implement override methods ...
}

Then you can create a new character MyCharacter

class MyCharacter extends GameEntity {
  MyCharacter(Vector position, Size size) : super(position, size);
  // ... Implement override methods ...
}

To add it to the game you have to call MyGame::entities.add(MyCharacter)

If you want to add an entity without gestures, you can extend it from RenderElement

class MyElement extends RenderElement {
  MyElement(Vector position, Size size) : super(position, size);
  // ... Implement override methods ...
}

Create the game widget #

In order to render and detect gestures you have to create a game widget:

class MyGameWidget extends GameWidget {
  MyGameWidget() : super(game: MyGame());
}

You can also add another widget to the game widget by calling MyGame::addChild(MyWidget)

Other resources #

Some useful resources are provided:

  • Sprite: Image loader and renderer.
  • FileManager: Synchronous file Manager.
  • Vector: 2D vector with various operations.

Example #

Possible future improvements #

For "completion", some planned features:

  • Detection of all gestures.
  • More basic components.
  • Audio support.

All contributions are warmly welcomed.

5
likes
0
pub points
0%
popularity

Publisher

unverified uploader

A small 2D game engine to easily create games in Flutter by providing different methods for rendering, gesture detection, etc.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter, path_provider, provider

More

Packages that depend on gamez