mirror of
https://github.com/exoticorn/microw8.git
synced 2026-01-20 11:16:42 +01:00
v0.1pre5 + some virtual fireworks for today
This commit is contained in:
32
examples/curlywas/fireworks.cwa
Normal file
32
examples/curlywas/fireworks.cwa
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
import "env.time" fn time() -> f32;
|
||||||
|
import "env.circle" fn circle(f32, f32, f32, i32);
|
||||||
|
import "env.cls" fn cls(i32);
|
||||||
|
import "env.randomSeed" fn seed(i32);
|
||||||
|
import "env.randomf" fn randomf() -> f32;
|
||||||
|
import "env.sin" fn sin(f32) -> f32;
|
||||||
|
import "env.cos" fn cos(f32) -> f32;
|
||||||
|
import "env.fmod" fn fmod(f32, f32) -> f32;
|
||||||
|
|
||||||
|
export fn upd() {
|
||||||
|
cls(0);
|
||||||
|
|
||||||
|
let i: i32;
|
||||||
|
loop pixels {
|
||||||
|
let inline rocket = i #>> 9;
|
||||||
|
let lazy local_time = fmod(time() + rocket as f32 / 5 as f32, 2 as f32);
|
||||||
|
let lazy rocket = rocket + nearest(time() - local_time) as i32 * 10;
|
||||||
|
seed(rocket);
|
||||||
|
let inline x = randomf() * 645 as f32;
|
||||||
|
let y = randomf() * 133 as f32;
|
||||||
|
let lazy angle = { seed(i); randomf() } * 44 as f32;
|
||||||
|
let inline dx = sin(angle);
|
||||||
|
let inline dy = cos(angle);
|
||||||
|
let lazy dist = local_time * (randomf() * 44 as f32);
|
||||||
|
circle(
|
||||||
|
x + dx * dist,
|
||||||
|
y + dy * dist + local_time * local_time * 24 as f32,
|
||||||
|
1 as f32, (rocket % 11 + 1) * 16 - (local_time * 7 as f32) as i32 - (i % 4)
|
||||||
|
);
|
||||||
|
branch_if (i := i + 1) < 5120: pixels;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -7,6 +7,7 @@
|
|||||||
* [v0.1pre2](v0.1pre2)
|
* [v0.1pre2](v0.1pre2)
|
||||||
* [v0.1pre3](v0.1pre3)
|
* [v0.1pre3](v0.1pre3)
|
||||||
* [v0.1pre4](v0.1pre4)
|
* [v0.1pre4](v0.1pre4)
|
||||||
|
* [v0.1pre5](v0.1pre5)
|
||||||
|
|
||||||
## Spec
|
## Spec
|
||||||
|
|
||||||
@@ -41,6 +42,8 @@ Other imports provided by the platform, also all in module `env`:
|
|||||||
* `fn hline(left: i32, right: i32, y: i32, color: i32)`
|
* `fn hline(left: i32, right: i32, y: i32, color: i32)`
|
||||||
* `fn rectangle(x1: f32, y1: f32, x2: f32, y2: f32, color: i32)`
|
* `fn rectangle(x1: f32, y1: f32, x2: f32, y2: f32, color: i32)`
|
||||||
* `fn circle(cx: f32, cy: f32, radius: f32, color: i32)`
|
* `fn circle(cx: f32, cy: f32, radius: f32, color: i32)`
|
||||||
|
* `fn rectangle_outline(x1: f32, y1: f32, x2: f32, y2: f32, color: i32)`
|
||||||
|
* `fn circle_outline(cx: f32, cy: f32, radius: f32, color: i32)`
|
||||||
* `fn line(x1: f32, y1: f32, x2: f32, y2: f32, color: i32)`
|
* `fn line(x1: f32, y1: f32, x2: f32, y2: f32, color: i32)`
|
||||||
|
|
||||||
* `fn time() -> f32`
|
* `fn time() -> f32`
|
||||||
@@ -116,6 +119,7 @@ Writing code for MicroW8 in C, Rust, AssemblyScript etc. should absolutely
|
|||||||
possible but no examples are provided, yet.
|
possible but no examples are provided, yet.
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
* [Fireworks](v0.1pre5#AgwvgP+M59snqjl4CMKw5sqm1Zw9yJCbSviMjeLUdHus2a3yl/a99+uiBeqZgP/2jqSjrLjRk73COMM6OSLpsxK8ugT1kuk/q4hQUqqPpGozHoa0laulzGGcahzdfdJsYaK1sIdeIYS9M5PnJx/Wk9H+PvWEPy2Zvv7I6IW7Fg==) (127 bytes): Some fireworks to welcome 2022.
|
||||||
* [Skip Ahead](v0.1pre4#AiP94km33q5hBFbBcKl2W1ZMY67wHByUz15/qRHIr71Dvq8bTVux/DXZzSTKU5MufRXxnGEn6mOul4dil/5WLT1Y+Y/4TGd1E3U4rQaxlpcKObxc5YLdr4xo6jyBND96a569LoECv6Q4EIqxJi+3QPE21r/++js41XsBLr44X/O2XpP3kHQva3B8o6duD5WkLCf7PhsxjTBeND1ADIaJe05JCrBim18RPY9VYFmltqQ9gVzbxE/ZpojR/GJ4aCbx0hRn73RPhpA7Cd4jk0AVSOeRx+7kuHrLzpaeqeYWK5pYd/4Rv+8=) (230 bytes): A port of my [TIC-80 256byte game](http://tic80.com/play?cart=1735) from LoveByte'21
|
* [Skip Ahead](v0.1pre4#AiP94km33q5hBFbBcKl2W1ZMY67wHByUz15/qRHIr71Dvq8bTVux/DXZzSTKU5MufRXxnGEn6mOul4dil/5WLT1Y+Y/4TGd1E3U4rQaxlpcKObxc5YLdr4xo6jyBND96a569LoECv6Q4EIqxJi+3QPE21r/++js41XsBLr44X/O2XpP3kHQva3B8o6duD5WkLCf7PhsxjTBeND1ADIaJe05JCrBim18RPY9VYFmltqQ9gVzbxE/ZpojR/GJ4aCbx0hRn73RPhpA7Cd4jk0AVSOeRx+7kuHrLzpaeqeYWK5pYd/4Rv+8=) (230 bytes): A port of my [TIC-80 256byte game](http://tic80.com/play?cart=1735) from LoveByte'21
|
||||||
* [OhNoAnotherTunnel](v0.1pre4#Ag95rdCB5Ww5NofyQaKF4P1mrNRso4azgiem4hK99Gh8OMzSpFq3NsNDo7O7pqln10D11l9uXr/ritw7OEzKwbEfCdvaRnS2Z0Kz0iDEZt/gIqOdvFmxsL1MjPQ4XInPbUJpQUonhQq29oP2omFabnQxn0bzoK7mZjcwc5GetHG+hGajkJcRr8oOnjfCol8RD+ha33GYtPnut+GLe4ktzf5UxZwGs6oT9qqC61lRDakN) (177 bytes): A port of my [entry](http://tic80.com/play?cart=1871) in the Outline'21 bytebattle final
|
* [OhNoAnotherTunnel](v0.1pre4#Ag95rdCB5Ww5NofyQaKF4P1mrNRso4azgiem4hK99Gh8OMzSpFq3NsNDo7O7pqln10D11l9uXr/ritw7OEzKwbEfCdvaRnS2Z0Kz0iDEZt/gIqOdvFmxsL1MjPQ4XInPbUJpQUonhQq29oP2omFabnQxn0bzoK7mZjcwc5GetHG+hGajkJcRr8oOnjfCol8RD+ha33GYtPnut+GLe4ktzf5UxZwGs6oT9qqC61lRDakN) (177 bytes): A port of my [entry](http://tic80.com/play?cart=1871) in the Outline'21 bytebattle final
|
||||||
* [Technotunnel](v0.1pre4#AqL8HeK1M9dn2nWNIF5vaq/Vh64pMt5nJIFoFKpBMPUsGtDtpqjo1JbT9LzPhAxCqJ7Yh4TA6oTGd4xhLowf+cWZMY73+7AZmfXJJsBi4cej/hH+4wlAgxFIrnOYnr/18IpnZbsHf0eGm1BhahX74+cVR0TRmNQmYC7GhCNS3mv/3MJn74lCj7t28aBJPjEZhP9fGXdG2u5Egh/Tjdg=) (158 bytes): A port of my [entry](https://tic80.com/play?cart=1873) in the Outline'21 bytebattle quater final
|
* [Technotunnel](v0.1pre4#AqL8HeK1M9dn2nWNIF5vaq/Vh64pMt5nJIFoFKpBMPUsGtDtpqjo1JbT9LzPhAxCqJ7Yh4TA6oTGd4xhLowf+cWZMY73+7AZmfXJJsBi4cej/hH+4wlAgxFIrnOYnr/18IpnZbsHf0eGm1BhahX74+cVR0TRmNQmYC7GhCNS3mv/3MJn74lCj7t28aBJPjEZhP9fGXdG2u5Egh/Tjdg=) (158 bytes): A port of my [entry](https://tic80.com/play?cart=1873) in the Outline'21 bytebattle quater final
|
||||||
|
|||||||
1
site/static/v0.1pre5/index.html
Normal file
1
site/static/v0.1pre5/index.html
Normal file
File diff suppressed because one or more lines are too long
@@ -4,7 +4,7 @@
|
|||||||
<section>
|
<section>
|
||||||
<h1 class="text-center heading-text">A WebAssembly based sizecoding platform</h1>
|
<h1 class="text-center heading-text">A WebAssembly based sizecoding platform</h1>
|
||||||
</section>
|
</section>
|
||||||
<a href="v0.1pre4">
|
<a href="v0.1pre5">
|
||||||
<div class="demonstration-gif" style="width:640px;height:512px;background-color:black"></div>
|
<div class="demonstration-gif" style="width:640px;height:512px;background-color:black"></div>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user