소스 검색

Exit the hello world sample when any key is released

Daniele Bartolini 12 년 전
부모
커밋
0f223747c2
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      samples/01.hello-world/lua/game.lua

+ 4 - 0
samples/01.hello-world/lua/game.lua

@@ -4,6 +4,10 @@ function init()
 end
 
 function frame(dt)
+	-- Stop the engine when any key is released
+	if Keyboard.any_released() then
+		Device.stop()
+	end
 end
 
 function shutdown()