User Manual: World Properties
From Color Infection Wiki
Contents |
Level Rules & Level Status
In playing, a world has 3 level statuses: succeeded, failed and unfinished.
The default initial value of level status is unfinished.
The level status can be determined by Color Infection rules or by custom rules. For custom rules, you can call the API SetLevelStaus to change level status.
Color Infection rules can be disabled.
If the SetLevelStaus API is called explicitly with a parameter value of succeeded or failed, then the final level status value is the parameter value. If the SetLevelStaus API is never called or it is called explicitly with a parameter value of unfinished, then the final level status is determined by the Color Infection rules.
Coordinates System
The default coordinate system of the world field is left-hand (CW), the x axis is toward right and the y axis is downward. To make the underlying physics engine, Box2D, stable in simulation, all display pixel units are converted to meter unit by a default scale 20 pixels per meter.
The coordinate system is configurable. But to notice:
- to make the simulation stable, it is best to keep the pixels-to-meter scale between 100 pixels/meter and 5 pixels/meter.
- currently, the function parameters is not supported well when the coordinate system is switched from left-hand to right hand or vice versa.
Physics Properties
The physics engine used in phyard builder is the famous box2d physics engine.
World Appearance
The world field size is configurable.
The Camera
You can make the camera follow an shape in 3 dimensions: x, y and rotation. You can also make the camera follow a shape in one dimension and follow another shape in another dimension.
There are 2 ways to set the followed shapes, one way is using the Camera Component, another way is by calling FollowCameraWithSahpe APIs.
The viewport of the cameras is configurable.