Skip to content
sonique6784 edited this page Jan 12, 2022 · 1 revision

Welcome to the ComposeGDK wiki!

Thanks for reaching this page, it shows your interest for the project and it is much appreciated.

Documentation

CGDKObject (GameObject)

the simplest object is CGDKObject, it has position and size, this can be extended to place more complex object on the screen, such as ImageCGDKObject.

GameCanvas

The GameObjects are placed on the Game Canvas

Scrollers

Both HorizontalScroll and VerticalScroll scroller have been implemented, they support speed which can be use to create a parallax effects. They take a list of CGDKObject and move them around the screen on the define axis (vertical, horizontal), and direction (up, down, left, right). Thanks to HorizontalAutoScroll and VerticalAutoScroll, it is possible to move the entire decor at a certain speed. This can help you implement a runner game or a time limited level in a platform game. This can also be used to move the decor behind your character. By using different speed for your decor, you can achieve a parallax effect.

Collision detector

The CollisionHelper is very simple at this stage, it help to determine if 2 objects has entered in collision, this is useful to prevent object going too far, determine if the hero has encounter an ennemie or to implement gravity. The current implementation assume a collision when the center of object A is in the area of object B.

We should implement addition helper that would be more sensitive, like as soon as the 2 object overlap. This will be useful to create Platform games where the character needs to land on a piece of decor.

Controllers

  • A Simple Keyboard controller that have 4 directions is implemented
  • A Draft of Touch and Joystick Virtual Controller (for touch screen) is implemented

Score

A basic score controller has been implemented: ScoreManager. it is using SharedFlow, how ever Channel could be considered.

Image / Resource Loader

Image loader leverage expected and actual to load images from different location depending on the platform. Currently, it loads the images as follows:

Compose Desktop

Images are loaded from the resources folder ./common/src/commonMain/resources/

Android

Images are loaded from the assets folder ./android/src/main/assets/ by using a symbolic link to prevent having to duplicate the assets.

Target state

Ideally the images should be placed in a single folder accessible from both Desktop and Android.