diff options
| author | Ray <[email protected]> | 2016-08-06 17:09:57 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2016-08-06 17:09:57 +0200 |
| commit | 7f9513fbf41e9d340307fc0f9aeed8e5f4293a96 (patch) | |
| tree | 197829790c7dd766f2b5f44df6e5b64d895b73e4 /examples/textures_particles_trail_blending.lua | |
| parent | 3b80e2c1e03e0f87d50ca8876b50a11c7df1f56f (diff) | |
| parent | 4960e6b6d7b4cba6125cfb8bb2fef043db8e5ba5 (diff) | |
| download | raylib-7f9513fbf41e9d340307fc0f9aeed8e5f4293a96.tar.gz raylib-7f9513fbf41e9d340307fc0f9aeed8e5f4293a96.zip | |
Merge pull request #173 from ghassanpl/develop
Fixes for some Lua bugs
Diffstat (limited to 'examples/textures_particles_trail_blending.lua')
| -rw-r--r-- | examples/textures_particles_trail_blending.lua | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/examples/textures_particles_trail_blending.lua b/examples/textures_particles_trail_blending.lua index d5ba7841..38036bcf 100644 --- a/examples/textures_particles_trail_blending.lua +++ b/examples/textures_particles_trail_blending.lua @@ -12,15 +12,6 @@ MAX_PARTICLES = 200 -- Particle structure with basic data -struct.Particle { - position, - color, - alpha, - size, - rotation, - active -- NOTE: Use it to activate/deactive particle -} - -- Initialization ------------------------------------------------------------------------------------------- local screenWidth = 800 @@ -33,6 +24,7 @@ local mouseTail = {} -- Initialize particles for i = 1, MAX_PARTICLES do + mouseTail[i] = {} mouseTail[i].position = Vector2(0, 0) mouseTail[i].color = Color(GetRandomValue(0, 255), GetRandomValue(0, 255), GetRandomValue(0, 255), 255) mouseTail[i].alpha = 1.0 @@ -45,7 +37,7 @@ local gravity = 3.0 local smoke = LoadTexture("resources/smoke.png") -local blending = BLEND.ALPHA +local blending = BlendMode.ALPHA SetTargetFPS(60) ------------------------------------------------------------------------------------------- @@ -80,8 +72,8 @@ while not WindowShouldClose() do -- Detect window close button or ESC end if (IsKeyPressed(KEY.SPACE)) then - if (blending == BLEND.ALPHA) then blending = BLEND_ADDITIVE - else blending = BLEND.ALPHA end + if (blending == BlendMode.ALPHA) then blending = BlendMode.ADDITIVE + else blending = BlendMode.ALPHA end end --------------------------------------------------------------------------------------- @@ -107,7 +99,7 @@ while not WindowShouldClose() do -- Detect window close button or ESC DrawText("PRESS SPACE to CHANGE BLENDING MODE", 180, 20, 20, BLACK) - if (blending == BLEND_ALPHA) then DrawText("ALPHA BLENDING", 290, screenHeight - 40, 20, BLACK) + if (blending == BlendMode.ALPHA) then DrawText("ALPHA BLENDING", 290, screenHeight - 40, 20, BLACK) else DrawText("ADDITIVE BLENDING", 280, screenHeight - 40, 20, RAYWHITE) end EndDrawing() |
