Throw a 6-sided dice, using physics, watch how it rolls.
Despite using the physics simulation (so it looks nice and random), the result is predetermined from the start. (This is achieved by first running physics simulation invisibly and then rotating the actual displayed dice to match the known end rotation.)
Using Castle Game Engine.
Note that a debug build (with DEBUG
symbol) shows additional UI to tweak physics parameters.
Play the web version without installation: https://castle-engine.io/web-demos/castle-dice-throwing/
Desktop versions (Windows, Linux): download release here: https://github.com/castle-engine/castle-dice-throwing/releases/latest
Copyright: Michalis Kamburelis.
License: BSD-3-Clause license, see LICENSE for details.
Except the dice 3D models, which are created by various artists (see data/AUTHORS.md) and are licensed under CC Attribution.
Compile by:
-
CGE editor. Just use menu items "Compile" or "Compile And Run".
-
Or use CGE command-line build tool. Run
castle-engine compile
in this directory. -
Or use Lazarus. Open in Lazarus
castle_dice_throwing_standalone.lpi
file and compile / run from Lazarus. Make sure to first register CGE Lazarus packages. -
Or use Delphi. Open in Delphi
castle_dice_throwing_standalone.dproj
file and compile / run from Delphi. See CGE and Delphi documentation for details.