From d5bd4d53dfcda03558be24e8c353fc042802c085 Mon Sep 17 00:00:00 2001 From: chai Date: Sun, 23 Dec 2018 14:24:49 +0800 Subject: =?UTF-8?q?*=20json\xml=E6=89=A9=E5=B1=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/game/main.lua | 36 +++++++++++++++++++++++------------- bin/jin.exe | Bin 541696 -> 561664 bytes 2 files changed, 23 insertions(+), 13 deletions(-) (limited to 'bin') diff --git a/bin/game/main.lua b/bin/game/main.lua index 224da77..a1794aa 100644 --- a/bin/game/main.lua +++ b/bin/game/main.lua @@ -81,10 +81,11 @@ function jin.core.onLoad() { name = 'panic', from = 'green', to = 'red' }, { name = 'calm', from = 'red', to = 'green' }, }}) - print(fsm.current) -- "none" + jin.log.info(fsm.current) -- "none" fsm:startup() - print(fsm.current) -- "green" - + jin.log.info(fsm.current) -- "green" + jin.log.info(jin.utils.json.encode({ 1, 2, 3, { x = 10 } })) + jin.log.info(jin.utils.json.decode('[1,2,3,{"x":10}]')) sinShader = jin.graphics.newShader[[ #VERTEX_SHADER Vertex vert(Vertex v) @@ -95,19 +96,29 @@ function jin.core.onLoad() #FRAGMENT_SHADER Color frag(Color col, Texture tex, Vertex v) { - col.r = 0; - col.g = 0; - col.b = 0; - float t = jin_Time.y * 60; - if(t < 0.9) - col.b = 1; - else - col.r = t; - + col.r = sin(jin_Time.x); + col.g = cos(jin_Time.x); + col.b = sin(jin_Time.x); return col; } #END_FRAGMENT_SHADER ]] + + jin.log.info("test") + + timer:every(1, function() + jin.log.info(jin.time.getFPS() .. " fps") + end) + + local xmlParser = jin.utils.xml.newParser() + local xml = xmlParser:ParseXmlText[[ + + + eight + twelve + + ]] + jin.log.info(xml.test["@one"]) end function jin.core.onEvent(e) @@ -120,7 +131,6 @@ local t = 0 function jin.core.onUpdate(dt) tb.x = t t = t + jin.time.getDelta() - print(jin.time.getFPS()) animator:update(jin.time.getDelta()) timer:update(jin.time.getDelta()) ps:update(dt) diff --git a/bin/jin.exe b/bin/jin.exe index 8fb4ff9..2e8b61f 100644 Binary files a/bin/jin.exe and b/bin/jin.exe differ -- cgit v1.1-26-g67d0