From a4fafcc64dc2ebc8711dca3607d16b027403b955 Mon Sep 17 00:00:00 2001 From: Igor Timofeev Date: Sun, 23 Aug 2015 15:15:51 +0300 Subject: [PATCH] Update Shooting.lua --- Applications/Shooting/Shooting.lua | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/Applications/Shooting/Shooting.lua b/Applications/Shooting/Shooting.lua index b18a7e55..b869110b 100644 --- a/Applications/Shooting/Shooting.lua +++ b/Applications/Shooting/Shooting.lua @@ -5,7 +5,10 @@ local ecs = require("ECSAPI") local colorlib = require("colorlib") --------------------------- -local xSize, ySize = gpu.getResolution() +local xOld, yOld = gpu.getResolution() +gpu.setResolution(160, 50) +local xSize, ySize = 160, 50 + local players = {...} local xCenter, yCenter = math.floor(xSize/4 - 15), math.floor(ySize/2) local symbols = { @@ -232,6 +235,10 @@ local function Tir() AddScore(e[6], GetScore(e[3], e[4])) SetPixel(e[3], e[4], players[e[6]][2]) showPlayers(111, 6) + elseif e[1] == "key_down" then + if e[4] == 28 then + return true + end end drawLastScore(50, 22, GetScore(e[3], e[4]),players[e[6]][2]) end @@ -243,5 +250,10 @@ showPlayers(111, 6) drawLastScore(50, 22, 0, 0xffffff) while true do - Tir() + local exit = Tir() + if exit then break end end + +gpu.setResolution(xOld, yOld) +ecs.prepareToExit() +