diff options
author | chai <chaifix@163.com> | 2018-11-22 16:15:48 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-11-22 16:15:48 +0800 |
commit | cfa05003be67344fbc79c338c2ac82f0accd979d (patch) | |
tree | 3ed1fa8cdeaf6210b1fd6271f28af24ab41ee55a /bin | |
parent | a0a1e1609fd65c2fe103cfe5a4532b7ccd492c7f (diff) |
*修改argc
Diffstat (limited to 'bin')
-rw-r--r-- | bin/Jin.exe | bin | 2312704 -> 2316800 bytes | |||
-rw-r--r-- | bin/SDL2.dll | bin | 1242112 -> 1242112 bytes | |||
-rw-r--r-- | bin/game/config.lua | 1 | ||||
-rw-r--r-- | bin/game/main.lua | 22 |
4 files changed, 8 insertions, 15 deletions
diff --git a/bin/Jin.exe b/bin/Jin.exe Binary files differindex bf2ca52..3e4b361 100644 --- a/bin/Jin.exe +++ b/bin/Jin.exe diff --git a/bin/SDL2.dll b/bin/SDL2.dll Binary files differindex 2276718..00ae787 100644 --- a/bin/SDL2.dll +++ b/bin/SDL2.dll diff --git a/bin/game/config.lua b/bin/game/config.lua index 380dd1b..095ee28 100644 --- a/bin/game/config.lua +++ b/bin/game/config.lua @@ -2,4 +2,5 @@ return { title = "window form", icon = "splash.png", + vsync = true }
\ No newline at end of file diff --git a/bin/game/main.lua b/bin/game/main.lua index 98f7bc7..b233272 100644 --- a/bin/game/main.lua +++ b/bin/game/main.lua @@ -56,7 +56,7 @@ local spr = nil local function createAnimation(path, count, r, c, w, h, loop, speed) local tex = jin.graphics.newTexture(path) local ssheet = jin.graphics.newSpriteSheet(tex) - local sprs = ssheet:newSprites(count, r, c, w, h, jin.graphics.SpriteOrigin.BOTTOMCENTER) + local sprs = ssheet:newSprites(count, r, c, w, h, 96, 168) return jin.graphics.newAnimation(sprs, loop, speed) end @@ -66,15 +66,11 @@ function jin.core.onLoad() 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 tex2 = jin.graphics.newTexture("anim.png") - local ssheet2 = jin.graphics.newSpriteSheet(tex2) local animation = createAnimation("anim2.png", 27, 3, 10, 200, 200, true, 50) animator = jin.graphics.newAnimator(animation) - local ssheet = jin.graphics.newSpriteSheet(tex) spr = animation:getFrame(1) - tex = nil + local tex3 = jin.graphics.newTexture("anim2.png") + tex3 = nil -- music = jin.audio.newSource("forest.ogg") -- music:setVolume(0.5) -- music:setLoop(true) @@ -82,22 +78,18 @@ function jin.core.onLoad() jin.graphics.clear() jin.graphics.showWindow() timer = jin.time.newTimer() - local h = timer:every(0.5, function(sp) - - end, spr) timer:every(3, function(p) --timer:cancel(h) if animator:getSpeed() == 50 then animator:setSpeed(100) elseif animator:getSpeed() == 100 then animator:setSpeed(50) - end + end end, animator) jin.graphics.pushMatrix() jin.graphics.translate(0, 0) --jin.graphics.rotate(0.2) end -local stop = false function jin.core.onEvent(e) if e.type == "Quit" then @@ -105,14 +97,14 @@ function jin.core.onEvent(e) end end -function jin.core.onUpdate() +function jin.core.onUpdate() tb.x = t t = t + jin.time.getDelta() animator:update(jin.time.getDelta()) + timer:update(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) @@ -122,7 +114,7 @@ function jin.core.onDraw() local x, y = jin.mouse.getPosition() animator:render(x, y, 1, 1, 0) jin.graphics.print(#sprs, 10, 10) - jin.graphics.draw(spr, 100, 100, 1, 1, 0) + jin.graphics.draw(spr, 100, 200, 1, 1, 0) --jin.graphics.useShader(shader_program2) --jin.graphics.draw(tex, 0, 0,0.2, 0.2) --jin.graphics.unuseShader() |