Skip to content

Commit

Permalink
New demos
Browse files Browse the repository at this point in the history
  • Loading branch information
michaliskambi committed Jan 6, 2025
1 parent f1aa7b0 commit f2b5cda
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 6 deletions.
2 changes: 1 addition & 1 deletion htdocs/web-demos/simplest/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<title>Simplest Web Application Using Castle Game Engine</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">

<script src="webgl-tests.js?random_suffix_to_avoid_cache=909"></script>
<script src="webgl-tests.js?random_suffix_to_avoid_cache=MJ668"></script>
<style>
body {
padding: 1em;
Expand Down
2 changes: 1 addition & 1 deletion htdocs/web-demos/simplest/webgl-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -6288,7 +6288,7 @@ rtl.module("program",["System","Classes","SysUtils","wasienv","Web","BrowserApp"
};
this.DoRun = function () {
pas.System.Writeln("Starting WebAssembly program from webgl-tests.wasm");
this.StartWebAssembly("webgl-tests.wasm?random_suffix_to_avoid_cache=Q087",true,rtl.createCallback(this,"DoBeforeStart"),null);
this.StartWebAssembly("webgl-tests.wasm?random_suffix_to_avoid_cache=VBMDGECB903",true,rtl.createCallback(this,"DoBeforeStart"),null);
this.Terminate();
};
this.Create$1 = function (aOwner) {
Expand Down
2 changes: 1 addition & 1 deletion htdocs/web-demos/simplest_invaders/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<title>Invaders</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">

<script src="simplest_invaders.js?random_suffix_to_avoid_cache=DOC704"></script>
<script src="simplest_invaders.js?random_suffix_to_avoid_cache=WHBKMCK244"></script>
<style>
body {
padding: 1em;
Expand Down
2 changes: 1 addition & 1 deletion htdocs/web-demos/simplest_invaders/simplest_invaders.js
Original file line number Diff line number Diff line change
Expand Up @@ -6288,7 +6288,7 @@ rtl.module("program",["System","Classes","SysUtils","wasienv","Web","BrowserApp"
};
this.DoRun = function () {
pas.System.Writeln("Starting WebAssembly program from simplest_invaders.wasm");
this.StartWebAssembly("simplest_invaders.wasm?random_suffix_to_avoid_cache=259",true,rtl.createCallback(this,"DoBeforeStart"),null);
this.StartWebAssembly("simplest_invaders.wasm?random_suffix_to_avoid_cache=YZZEW131",true,rtl.createCallback(this,"DoBeforeStart"),null);
this.Terminate();
};
this.Create$1 = function (aOwner) {
Expand Down
18 changes: 18 additions & 0 deletions htdocs/web-demos/simplest_viewport/a.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
We are proud to present the first 3 working applications developed with _Castle Game Engine_ for the web! Check them out -- just open the links below, in any www browser (Firefox, Chrome...), on desktop or mobile!

1. [3D viewport, with random cones, animated spot light, dropping boxes with physics, Examine camera navigation](https://castle-engine.io/web-demos/simplest_viewport).

2. [2D "Invaders" game - simple game, using keys, multiple views, 2 difficulty modes](https://castle-engine.io/web-demos/simplest_invaders). Note: This example is not really useful on mobile, just because it relies on the keyboard input.

3. [The first, simplest example that we got running on the web!](https://castle-engine.io/web-demos/simplest)

How is this possible?

- We use the WebAssembly target available in [FPC](https://www.freepascal.org/) and we have a "glue" code generated using [Pas2JS](https://getpas2js.freepascal.org/). We render using WebGL (1.0, with 2.0 features useful but optional), using the [Castle Game Engine](https://castle-engine.io/) code. The game code is cross-platform (the 3 examples above can be recompiled to desktop, mobile, console without any change). The [cgeref id=TCastleWindow] abstracts all platform differences providing rendering and handling input (key, mouse, touch).

- This is not yet available in the CGE `master` branch, not yet available in the downloads! The development is on a branch [webassm_platformer_test](https://github.com/castle-engine/castle-engine/tree/webassm_platformer_test). It should be merged to `master` soon.

- We have a ton of documentation what works already, how it works, what is missing, and what do we plan on the [web platform page](https://castle-engine.io/web). This was quite intensitively updated in the last 2 weeks, so check it out!

Do you like what we do? Spread the word to your friends and [support us on Patreon](https://www.patreon.com/castleengine)! And have fun developing games with our open-source game engine :)

2 changes: 1 addition & 1 deletion htdocs/web-demos/simplest_viewport/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<title>Viewport with 3D fun</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">

<script src="simplest_viewport.js?random_suffix_to_avoid_cache=KZALNMGO602"></script>
<script src="simplest_viewport.js?random_suffix_to_avoid_cache=GRT243"></script>
<style>
body {
padding: 1em;
Expand Down
2 changes: 1 addition & 1 deletion htdocs/web-demos/simplest_viewport/simplest_viewport.js
Original file line number Diff line number Diff line change
Expand Up @@ -6288,7 +6288,7 @@ rtl.module("program",["System","Classes","SysUtils","wasienv","Web","BrowserApp"
};
this.DoRun = function () {
pas.System.Writeln("Starting WebAssembly program from simplest_viewport.wasm");
this.StartWebAssembly("simplest_viewport.wasm?random_suffix_to_avoid_cache=JGEHZCJ106",true,rtl.createCallback(this,"DoBeforeStart"),null);
this.StartWebAssembly("simplest_viewport.wasm?random_suffix_to_avoid_cache=ZRKCB779",true,rtl.createCallback(this,"DoBeforeStart"),null);
this.Terminate();
};
this.Create$1 = function (aOwner) {
Expand Down

0 comments on commit f2b5cda

Please sign in to comment.