diff options
Diffstat (limited to 'bin')
-rw-r--r-- | bin/Jin.exe | bin | 510464 -> 2263040 bytes | |||
-rw-r--r-- | bin/SDL2.dll | bin | 996352 -> 1242112 bytes | |||
-rw-r--r-- | bin/font.png | bin | 2780 -> 0 bytes | |||
-rw-r--r-- | bin/font.shader | 26 | ||||
-rw-r--r-- | bin/font2.png | bin | 2758 -> 0 bytes | |||
-rw-r--r-- | bin/game/0.png | bin | 0 -> 563072 bytes | |||
-rw-r--r-- | bin/game/1.png | bin | 0 -> 73228 bytes | |||
-rw-r--r-- | bin/game/SDL.jpg | bin | 0 -> 6481 bytes | |||
-rw-r--r-- | bin/game/config.lua | 5 | ||||
-rw-r--r-- | bin/game/forest.ogg | bin | 0 -> 789109 bytes | |||
-rw-r--r-- | bin/game/icon.ico | bin | 0 -> 85182 bytes | |||
-rw-r--r-- | bin/game/main.lua | 102 | ||||
-rw-r--r-- | bin/game/splash.png | bin | 0 -> 392 bytes | |||
-rw-r--r-- | bin/img2.bmp | bin | 12342 -> 0 bytes | |||
-rw-r--r-- | bin/intro.ogg | bin | 1221422 -> 0 bytes | |||
-rw-r--r-- | bin/intro_logo.wav | bin | 685750 -> 0 bytes | |||
-rw-r--r-- | bin/jin.exe | bin | 510464 -> 2263040 bytes | |||
-rw-r--r-- | bin/lua51.dll | bin | 364544 -> 0 bytes | |||
-rw-r--r-- | bin/main.lua | 121 | ||||
-rw-r--r-- | bin/music.ogg | bin | 2121836 -> 0 bytes | |||
-rw-r--r-- | bin/text.txt | 1 |
21 files changed, 107 insertions, 148 deletions
diff --git a/bin/Jin.exe b/bin/Jin.exe Binary files differindex 1c7f23f..8251ee4 100644 --- a/bin/Jin.exe +++ b/bin/Jin.exe diff --git a/bin/SDL2.dll b/bin/SDL2.dll Binary files differindex c21f747..3aaf046 100644 --- a/bin/SDL2.dll +++ b/bin/SDL2.dll diff --git a/bin/font.png b/bin/font.png Binary files differdeleted file mode 100644 index 151b992..0000000 --- a/bin/font.png +++ /dev/null diff --git a/bin/font.shader b/bin/font.shader deleted file mode 100644 index 7b714db..0000000 --- a/bin/font.shader +++ /dev/null @@ -1,26 +0,0 @@ -#VERTEX_SHADER - -Vertex vert(Vertex v) -{ - return v; -} - -#END_VERTEX_SHADER - -#FRAGMENT_SHADER - -uniform float dt; - -Color frag(Color col, Texture tex, Vertex v) -{ - Color c = texel(tex, v.uv); - c.r *= sin(dt); - c.g *= sin(dt / 3); - c.a *= sin(dt / 2); - return c; -} -//1.21 1.34 - - asdas -//stbi_write_png -#END_FRAGMENT_SHADER
\ No newline at end of file diff --git a/bin/font2.png b/bin/font2.png Binary files differdeleted file mode 100644 index 6083ab6..0000000 --- a/bin/font2.png +++ /dev/null diff --git a/bin/game/0.png b/bin/game/0.png Binary files differnew file mode 100644 index 0000000..fa62576 --- /dev/null +++ b/bin/game/0.png diff --git a/bin/game/1.png b/bin/game/1.png Binary files differnew file mode 100644 index 0000000..7e3fe49 --- /dev/null +++ b/bin/game/1.png diff --git a/bin/game/SDL.jpg b/bin/game/SDL.jpg Binary files differnew file mode 100644 index 0000000..dcd530a --- /dev/null +++ b/bin/game/SDL.jpg diff --git a/bin/game/config.lua b/bin/game/config.lua new file mode 100644 index 0000000..380dd1b --- /dev/null +++ b/bin/game/config.lua @@ -0,0 +1,5 @@ +return +{ + title = "window form", + icon = "splash.png", +}
\ No newline at end of file diff --git a/bin/game/forest.ogg b/bin/game/forest.ogg Binary files differnew file mode 100644 index 0000000..d3059e1 --- /dev/null +++ b/bin/game/forest.ogg diff --git a/bin/game/icon.ico b/bin/game/icon.ico Binary files differnew file mode 100644 index 0000000..3043332 --- /dev/null +++ b/bin/game/icon.ico diff --git a/bin/game/main.lua b/bin/game/main.lua new file mode 100644 index 0000000..ce22f46 --- /dev/null +++ b/bin/game/main.lua @@ -0,0 +1,102 @@ +io.stdout:setvbuf("no") +local shader = [[ +#VERTEX_SHADER +Vertex vert(Vertex v) +{ + return v; +} +#END_VERTEX_SHADER +#FRAGMENT_SHADER +Color frag(Color col, Texture tex, Vertex v) +{ + return col; +} +#END_FRAGMENT_SHADER +]] + +local shader2 = [[ +#VERTEX_SHADER +Vertex vert(Vertex v) +{ + return v; +} +#END_VERTEX_SHADER +#FRAGMENT_SHADER +Color frag(Color col, Texture tex, Vertex v) +{ + Color c = texel(tex, v.uv); + return c; +} +#END_FRAGMENT_SHADER +]] +music = nil +local tex = nil +local shader_program = nil +local shader_program2 = nil +local timer = nil +local tb = {x = 1, y = 2} +local t = 0 +local spr = nil +local bitmap = nil +function jin.core.onLoad() + bitmap = jin.graphics.newBitmap(128, 128, function(w, h, x, y) + return {255*math.sin(x/w),255 - 255*math.cos(y/w),0,255} + end) + shader_program = jin.graphics.newShader(shader) + shader_program2 = jin.graphics.newShader(shader2) + --tex = jin.graphics.newTexture("1.png") + tex = jin.graphics.newTexture(bitmap) + local ssheet = jin.graphics.newSpriteSheet(tex) + spr = ssheet:newSprite(50, 50, 50, 50) + spr:setPosition(0, 50) + spr:setShader(shader_program2) + tex = nil + spr:setScale(2, 2) + spr:setColor(100, 0, 100, 255) + spr:setOrigin(jin.graphics.SpriteOrigin.BOTTOMCENTER) + -- music = jin.audio.newSource("forest.ogg") + -- music:setVolume(0.5) + -- music:setLoop(true) + --music:play() + jin.graphics.clear() + jin.graphics.showWindow() + timer = jin.time.newTimer() + local h = timer:every(0.5, function(sp) + local x, y = spr:getPosition() + spr:move(5, 0) + end, spr) + timer:after(3, function(p) + --timer:cancel(h) + end, h) + jin.graphics.pushMatrix() + --jin.graphics.translate(100, 0) + jin.graphics.rotate(0.2) +end +local stop = false + +function jin.core.onEvent(e) + if e.type == "Quit" then + jin.core.stop() + end +end + +function jin.core.onUpdate() + tb.x = t + t = t + jin.time.getDelta() +end + +function jin.core.onDraw() + timer:update(jin.time.getDelta()) + jin.graphics.useShader(shader_program) + jin.graphics.setColor(255, 0, 255, 255) + jin.graphics.rect(jin.graphics.RenderMode.FILL, 30, 50, 100, 200) + jin.graphics.setColor(255, 255, 255, 255) + jin.graphics.unuseShader() + spr:render() + --jin.graphics.useShader(shader_program2) + --jin.graphics.draw(tex, 0, 0,0.2, 0.2) + --jin.graphics.unuseShader() + if stop then + jin.graphics.print("Quit", 100, 300) + end +end
\ No newline at end of file diff --git a/bin/game/splash.png b/bin/game/splash.png Binary files differnew file mode 100644 index 0000000..b0c4256 --- /dev/null +++ b/bin/game/splash.png diff --git a/bin/img2.bmp b/bin/img2.bmp Binary files differdeleted file mode 100644 index dc9cf95..0000000 --- a/bin/img2.bmp +++ /dev/null diff --git a/bin/intro.ogg b/bin/intro.ogg Binary files differdeleted file mode 100644 index 9ba4905..0000000 --- a/bin/intro.ogg +++ /dev/null diff --git a/bin/intro_logo.wav b/bin/intro_logo.wav Binary files differdeleted file mode 100644 index 828c423..0000000 --- a/bin/intro_logo.wav +++ /dev/null diff --git a/bin/jin.exe b/bin/jin.exe Binary files differindex 1c7f23f..8251ee4 100644 --- a/bin/jin.exe +++ b/bin/jin.exe diff --git a/bin/lua51.dll b/bin/lua51.dll Binary files differdeleted file mode 100644 index dd93ee2..0000000 --- a/bin/lua51.dll +++ /dev/null diff --git a/bin/main.lua b/bin/main.lua deleted file mode 100644 index af78076..0000000 --- a/bin/main.lua +++ /dev/null @@ -1,121 +0,0 @@ -io.stdout:setvbuf("no") - -local shader -local text -local page -local tf -local sprites -local ttf -function jin.core.onLoad() - shader = jin.graphics.newShaderf("font.shader") - -- local bitmap = jin.graphics.newBitmap("defaultfont.png") - -- local tfdata = jin.graphics.newTTFData("font.ttf") - -- tf = tfdata:newTTF(13) - -- page = tf:typeset("this is a test") - jin.graphics.setClearColor(100, 100, 100, 255) - sprites = jin.graphics.newTexture("sprites.png") - -- local ttfdata = jin.graphics.newTTFData("font_pixel.ttf") - -- ttf = ttfdata:newTTF(22); - local bitmap = jin.graphics.newBitmap("font2.png") - tf = jin.graphics.newTextureFont(bitmap, [[<=>?.'^@abcdefghijklmnopqrstuvwxyz|~[\]_]], {255, 0, 0, 255}, 16) -end -local value = 0 -function jin.core.onEvent(e) - if e.type == "Quit" then - jin.core.stop() - end - if e.type == "KeyDown" then - if e.key == "Up" then - value = value + 0.01 - end - if e.key == "Down" then - value = value - 0.01 - end - end -end -local t = 0 -local fps = 0 -local f = 0 -function jin.core.onUpdate(dt) - t = t + dt - f = f + 1 - if t > 1 then - fps = f - f = 0 - t = t - 1 - end -end - -function run() - ---#if editor - - ---#endif -end - -function jin.core.onDraw() - jin.graphics.setColor(255, 255, 255) - --jin.graphics.draw(sprites, 10, 10, 1, 1) - -- jin.graphics.setFont(tf) - jin.graphics.useShader(shader) - shader:sendNumber("dt", t) - jin.graphics.print(value) - jin.graphics.print([[ -#VERTEX_SHADER - -Vertex vert(Vertex v) -{ - return v; -} - -#END_VERTEX_SHADER - -#FRAGMENT_SHADER - -uniform float dt; - -Color frag(Color col, Texture tex, Vertex v) -{ - Color c = texel(tex, v.uv); - if(c.a < 0.9f) - { - c.a /= 1.34; - } - return c; -} -//1.21 1.34 - -//stbi_write_png -#END_FRAGMENT_SHADER - - ]], 0, 20) - jin.graphics.unuseShader() - jin.graphics.print([[ -#VERTEX_SHADER - -Vertex vert(Vertex v) -{ - return v; -} - -#END_VERTEX_SHADER - -#FRAGMENT_SHADER - -uniform float dt; - -Color frag(Color col, Texture tex, Vertex v) -{ - Color c = texel(tex, v.uv); - if(c.a < 0.9f) - { - c.a /= 1.34; - } - return c; -} -//1.21 1.34 - -//stbi_write_png -#END_FRAGMENT_SHADER - - ]], 300, 20) -end diff --git a/bin/music.ogg b/bin/music.ogg Binary files differdeleted file mode 100644 index 9d44af6..0000000 --- a/bin/music.ogg +++ /dev/null diff --git a/bin/text.txt b/bin/text.txt deleted file mode 100644 index 33c6055..0000000 --- a/bin/text.txt +++ /dev/null @@ -1 +0,0 @@ -开始
\ No newline at end of file |