refactor some api things
This commit is contained in:
parent
27b6459b9a
commit
1634b1126b
9 changed files with 35 additions and 34 deletions
|
|
@ -19,10 +19,11 @@
|
|||
(var transition-pending nil)
|
||||
|
||||
(fn switch-demo [new-demo]
|
||||
(set transition-pending new-demo)
|
||||
(set transition (pxl8.transition_create :pixelate 0.5))
|
||||
(pxl8.transition_set_color transition 0xFF000000)
|
||||
(pxl8.transition_start transition))
|
||||
(when (not= active-demo new-demo)
|
||||
(set transition-pending new-demo)
|
||||
(set transition (pxl8.transition_create :pixelate 0.5))
|
||||
(pxl8.transition_set_color transition 0xFF000000)
|
||||
(pxl8.transition_start transition)))
|
||||
|
||||
(global init (fn []
|
||||
(cube3d.init)
|
||||
|
|
@ -77,7 +78,7 @@
|
|||
(global frame (fn []
|
||||
(case active-demo
|
||||
:logo (do
|
||||
(pxl8.clr 0)
|
||||
(pxl8.clear 0)
|
||||
(when logo-sprite
|
||||
(pxl8.sprite logo-sprite logo-x logo-y 128 64)))
|
||||
|
||||
|
|
@ -86,14 +87,14 @@
|
|||
:tunnel (pxl8.vfx_tunnel time 2.0 0.25)
|
||||
|
||||
:raster (do
|
||||
(pxl8.clr 0)
|
||||
(pxl8.clear 0)
|
||||
(local bars [{:base_y 60 :amplitude 30 :height 16 :speed 2.0 :phase 0 :color 1 :fade_color 18}
|
||||
{:base_y 180 :amplitude 35 :height 16 :speed 1.8 :phase 2.0 :color 1 :fade_color 27}
|
||||
{:base_y 300 :amplitude 25 :height 16 :speed 2.2 :phase 4.0 :color 1 :fade_color 24}])
|
||||
(pxl8.vfx_raster_bars bars time))
|
||||
|
||||
:fire (do
|
||||
(pxl8.clr 0)
|
||||
(pxl8.clear 0)
|
||||
(when particles
|
||||
(when (not fire-init?)
|
||||
(pxl8.particles_clear particles)
|
||||
|
|
@ -102,7 +103,7 @@
|
|||
(pxl8.particles_render particles)))
|
||||
|
||||
:rain (do
|
||||
(pxl8.clr 0)
|
||||
(pxl8.clear 0)
|
||||
(when particles
|
||||
(when (not rain-init?)
|
||||
(pxl8.particles_clear particles)
|
||||
|
|
@ -111,7 +112,7 @@
|
|||
(pxl8.particles_render particles)))
|
||||
|
||||
:snow (do
|
||||
(pxl8.clr 0)
|
||||
(pxl8.clear 0)
|
||||
(when particles
|
||||
(when (not snow-init?)
|
||||
(pxl8.particles_clear particles)
|
||||
|
|
@ -123,7 +124,7 @@
|
|||
|
||||
:worldgen (worldgen.frame)
|
||||
|
||||
_ (pxl8.clr 0))
|
||||
_ (pxl8.clear 0))
|
||||
|
||||
(when transition
|
||||
(pxl8.transition_render transition))))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue