diff options
Diffstat (limited to 'bin')
-rw-r--r-- | bin/SDL2.dll | bin | 1242112 -> 771072 bytes | |||
-rw-r--r-- | bin/game/dust/s_dust_A_0.png | bin | 0 -> 82 bytes | |||
-rw-r--r-- | bin/game/dust/s_dust_A_1.png | bin | 0 -> 93 bytes | |||
-rw-r--r-- | bin/game/dust/s_dust_A_10.png | bin | 0 -> 84 bytes | |||
-rw-r--r-- | bin/game/dust/s_dust_A_2.png | bin | 0 -> 94 bytes | |||
-rw-r--r-- | bin/game/dust/s_dust_A_3.png | bin | 0 -> 95 bytes | |||
-rw-r--r-- | bin/game/dust/s_dust_A_4.png | bin | 0 -> 76 bytes | |||
-rw-r--r-- | bin/game/dust/s_dust_A_5.png | bin | 0 -> 88 bytes | |||
-rw-r--r-- | bin/game/dust/s_dust_A_6.png | bin | 0 -> 87 bytes | |||
-rw-r--r-- | bin/game/dust/s_dust_A_7.png | bin | 0 -> 84 bytes | |||
-rw-r--r-- | bin/game/dust/s_dust_A_8.png | bin | 0 -> 86 bytes | |||
-rw-r--r-- | bin/game/dust/s_dust_A_9.png | bin | 0 -> 83 bytes | |||
-rw-r--r-- | bin/game/main.lua | 42 | ||||
-rw-r--r-- | bin/jin.exe | bin | 1703424 -> 554496 bytes | |||
-rw-r--r-- | bin/lua51.dll | bin | 364544 -> 364544 bytes |
15 files changed, 24 insertions, 18 deletions
diff --git a/bin/SDL2.dll b/bin/SDL2.dll Binary files differindex 47c1b1e..3f6f1d5 100644 --- a/bin/SDL2.dll +++ b/bin/SDL2.dll diff --git a/bin/game/dust/s_dust_A_0.png b/bin/game/dust/s_dust_A_0.png Binary files differnew file mode 100644 index 0000000..79efc70 --- /dev/null +++ b/bin/game/dust/s_dust_A_0.png diff --git a/bin/game/dust/s_dust_A_1.png b/bin/game/dust/s_dust_A_1.png Binary files differnew file mode 100644 index 0000000..acc2100 --- /dev/null +++ b/bin/game/dust/s_dust_A_1.png diff --git a/bin/game/dust/s_dust_A_10.png b/bin/game/dust/s_dust_A_10.png Binary files differnew file mode 100644 index 0000000..e422644 --- /dev/null +++ b/bin/game/dust/s_dust_A_10.png diff --git a/bin/game/dust/s_dust_A_2.png b/bin/game/dust/s_dust_A_2.png Binary files differnew file mode 100644 index 0000000..1ef2056 --- /dev/null +++ b/bin/game/dust/s_dust_A_2.png diff --git a/bin/game/dust/s_dust_A_3.png b/bin/game/dust/s_dust_A_3.png Binary files differnew file mode 100644 index 0000000..ca2260a --- /dev/null +++ b/bin/game/dust/s_dust_A_3.png diff --git a/bin/game/dust/s_dust_A_4.png b/bin/game/dust/s_dust_A_4.png Binary files differnew file mode 100644 index 0000000..1f67b79 --- /dev/null +++ b/bin/game/dust/s_dust_A_4.png diff --git a/bin/game/dust/s_dust_A_5.png b/bin/game/dust/s_dust_A_5.png Binary files differnew file mode 100644 index 0000000..3969a04 --- /dev/null +++ b/bin/game/dust/s_dust_A_5.png diff --git a/bin/game/dust/s_dust_A_6.png b/bin/game/dust/s_dust_A_6.png Binary files differnew file mode 100644 index 0000000..d2d6df0 --- /dev/null +++ b/bin/game/dust/s_dust_A_6.png diff --git a/bin/game/dust/s_dust_A_7.png b/bin/game/dust/s_dust_A_7.png Binary files differnew file mode 100644 index 0000000..02ba310 --- /dev/null +++ b/bin/game/dust/s_dust_A_7.png diff --git a/bin/game/dust/s_dust_A_8.png b/bin/game/dust/s_dust_A_8.png Binary files differnew file mode 100644 index 0000000..700052c --- /dev/null +++ b/bin/game/dust/s_dust_A_8.png diff --git a/bin/game/dust/s_dust_A_9.png b/bin/game/dust/s_dust_A_9.png Binary files differnew file mode 100644 index 0000000..8de4fcf --- /dev/null +++ b/bin/game/dust/s_dust_A_9.png diff --git a/bin/game/main.lua b/bin/game/main.lua index 8de71f1..3e5182b 100644 --- a/bin/game/main.lua +++ b/bin/game/main.lua @@ -61,6 +61,7 @@ local function createAnimation(path, count, r, c, w, h, loop, speed) local sprs = ssheet:newSprites(count, r, c, w, h, 96, 168) return jin.graphics.newAnimation(sprs, loop, speed) end +local particle_sprites = {} local Pi = 3.1415 function jin.core.onLoad() -- bitmap = jin.graphics.newBitmap(200, 200, function(w, h, x, y) @@ -69,22 +70,25 @@ function jin.core.onLoad() local tex = jin.graphics.newTexture("particle.png") particle_sprite = jin.graphics.newSprite(tex, jin.graphics.SpriteOrigin.MIDDLECENTER) ps = jin.graphics.newParticleSystem() - - ps:setEmitRate(0.02); - ps:setEmitForce(80, 120); - ps:setEmitPosition({50, 50}); - ps:setEmitDirection(-Pi / 10 - Pi / 2, Pi / 10 - Pi / 2); - ps:setParticleLinearAccelaration({0, 10}); - ps:setParticleSpritesMode(jin.graphics.SpriteMode.SINGLE); - ps:setParticleColor({255, 30, 0, 255}); - ps:addParticleTransparencyPoint(1, 0); - ps:addParticleTransparencyPoint(0, 0.5); - ps:enableParticleBlendAdditive(true); - ps:setParticleLife(0.5, 2); - ps:addParticleScalePoint(3, 0); - ps:addParticleScalePoint(0, 1); - ps:addParticleSprite(particle_sprite) - + for i = 0, 10 do + local t = jin.graphics.newTexture("dust/s_dust_A_" .. i .. ".png") + local spr = jin.graphics.newSprite(t, jin.graphics.SpriteOrigin.MIDDLECENTER) + ps:addParticleSprite(spr) + end + ps:setEmitRate(0.02) + ps:setEmitForce(80, 120) + ps:setEmitPosition({0, 0}) + ps:setEmitDirection(-Pi / 10 - Pi / 2, Pi / 10 - Pi / 2) + ps:setParticleLinearAccelaration({0, 10}) + ps:setParticleSpritesMode(jin.graphics.SpriteMode.ANIMATED) + ps:setParticleColor({255, 30, 0, 255}) + ps:addParticleTransparencyPoint(1, 0) + ps:addParticleTransparencyPoint(0, 0.5) + ps:enableParticleBlendAdditive(true) + ps:setParticleLife(0.5, 2) + ps:addParticleScalePoint(3, 0) + ps:addParticleScalePoint(0, 1) + --ps:addParticleSprite(particle_sprite) shader_program = jin.graphics.newShader(shader) shader_program2 = jin.graphics.newShader(shader2) local animation = createAnimation("anim2.png", 27, 3, 10, 200, 200, true, 50) @@ -95,7 +99,7 @@ function jin.core.onLoad() -- music = jin.audio.newSource("forest.ogg") -- music:setVolume(0.5) -- music:setLoop(true) - --music:play() + -- music:play() jin.graphics.clear() jin.graphics.showWindow() timer = jin.time.newTimer() @@ -124,6 +128,8 @@ function jin.core.onUpdate(dt) animator:update(jin.time.getDelta()) timer:update(jin.time.getDelta()) ps:update(dt) + local mx, my = jin.mouse.getPosition() + ps:setPosition(mx, my) end function jin.core.onDraw() @@ -134,7 +140,7 @@ function jin.core.onDraw() jin.graphics.unuseShader() --jin.graphics.draw(sprs[2], 150, 150, 1, 1, 0) local x, y = jin.mouse.getPosition() - animator:render(x, y, 1, 1, 0) + animator:render(50, 150, 1, 1, 0) ps:render() --jin.graphics.print(#sprs, 10, 10) jin.graphics.draw(spr, 100, 200, 1, 1, 0) diff --git a/bin/jin.exe b/bin/jin.exe Binary files differindex fffa828..0bd7bc7 100644 --- a/bin/jin.exe +++ b/bin/jin.exe diff --git a/bin/lua51.dll b/bin/lua51.dll Binary files differindex 4857c1e..175f5c1 100644 --- a/bin/lua51.dll +++ b/bin/lua51.dll |