From f43e0c25b2d0efcb40abbf1640e5417425b2f3fb Mon Sep 17 00:00:00 2001 From: serxoz Date: Sat, 28 May 2022 00:05:01 +0200 Subject: [PATCH] primeiro --- README.md | 2 + TODO | 3 + entidades/ovella.lua | 56 +++++++ entidades/pastor.lua | 35 +++++ img/cercado.png | Bin 0 -> 6377 bytes img/fondo.png | Bin 0 -> 11730 bytes img/ovella.png | Bin 0 -> 4260 bytes img/pastor.png | Bin 0 -> 920 bytes img/valla.png | Bin 0 -> 46479 bytes lib/inspect.lua | 337 +++++++++++++++++++++++++++++++++++++++++++ main.lua | 82 +++++++++++ 11 files changed, 515 insertions(+) create mode 100644 README.md create mode 100644 TODO create mode 100644 entidades/ovella.lua create mode 100644 entidades/pastor.lua create mode 100644 img/cercado.png create mode 100644 img/fondo.png create mode 100644 img/ovella.png create mode 100644 img/pastor.png create mode 100644 img/valla.png create mode 100644 lib/inspect.lua create mode 100644 main.lua diff --git a/README.md b/README.md new file mode 100644 index 0000000..d5a867d --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# Ovellas +Xogo de pastorear ovellas diff --git a/TODO b/TODO new file mode 100644 index 0000000..11d6885 --- /dev/null +++ b/TODO @@ -0,0 +1,3 @@ +- muros +- comprobación perímetro cercado (ovella dentro?) +- puntuación e tempo en completar diff --git a/entidades/ovella.lua b/entidades/ovella.lua new file mode 100644 index 0000000..27c0e2f --- /dev/null +++ b/entidades/ovella.lua @@ -0,0 +1,56 @@ +Ovella = {} +local OvellaMT = {__index = Ovella} + +function Ovella:new(id, x, y) + local instance = {} + instance.id = id + instance.sprite = love.graphics.newImage("img/ovella.png") + instance.width = instance.sprite:getWidth() + instance.height = instance.sprite:getHeight() + instance.x = x-instance.width/2 + instance.y = y-instance.height/2 + instance.speed = 1 + + return setmetatable(instance, OvellaMT) +end + +function Ovella:update(pastor) + -- vector + local X = pastor.x - self.x; + local Y = pastor.y - self.y; + distancia = math.sqrt(math.pow(X, 2) + math.pow(Y, 2)); + + --normalizase o vector + X = X / distancia; + Y = Y / distancia; + + -- redondease ó int máis cercano + if X < 0 then + X = math.floor(X - 0.5); + else + X = math.floor(X + 0.5); + end + if Y < 0 then + Y = math.floor(Y - 0.5); + else + Y = math.floor(Y + 0.5); + end + + -- velocidade + dX = X * self.speed; + dY = Y * self.speed; + + if distancia < DISTANCIA then + -- movemento + -- FIXME comprobar que non se vai de marxenes e non choca con muros + self.x = self.x - dX; + self.y = self.y - dY; + end + +end + +function Ovella:draw() + love.graphics.draw(self.sprite, self.x, self.y) +end + +return Ovella diff --git a/entidades/pastor.lua b/entidades/pastor.lua new file mode 100644 index 0000000..69800b7 --- /dev/null +++ b/entidades/pastor.lua @@ -0,0 +1,35 @@ +Pastor = {} + +function Pastor:new(x, y) + self.sprite = love.graphics.newImage("img/pastor.png") + self.width = self.sprite:getWidth() + self.height = self.sprite:getHeight() + self.x = x-self.width/2 + self.y = y-self.height/2 + self.speed = 2 + + return self +end + +function Pastor:update(dt) + local width, height, flags = love.window.getMode(); + width = width - self.width + height = height - self.height + + if love.keyboard.isDown("up") and self.y > 0 then + self.y = self.y - self.speed + end + if love.keyboard.isDown("down") and self.y < height then + self.y = self.y + self.speed + end + if love.keyboard.isDown("left") and self.x > 0 then + self.x = self.x - self.speed + end + if love.keyboard.isDown("right") and self.x < width then + self.x = self.x + self.speed + end +end + +function Pastor:draw() + love.graphics.draw(self.sprite, self.x, self.y) +end diff --git a/img/cercado.png b/img/cercado.png new file mode 100644 index 0000000000000000000000000000000000000000..99a871ac1fd2de72a5dbaead0608e9b60801d85a GIT binary patch literal 6377 zcmbVQ2UJtrwhgFo5fGH76j31{(gXx9ohu5&NRb+9D28$&6zM`JN)e<;C;<@=M3EMH zP#^)NM7oAvBSkRu5_-u$-uvGB?~U=tAAkHaMo!s#pX{~Inrp7PcC4Yk4(nOovmg+N z6{35`2n3>&0Pfd*V*t*&{*-Z`A<|V#%MhZab;awEr<1EY0tC9Aj7nD1ZPDa!gBwHd z7C&)f_x{Z&TjE*V?|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)*i4;D#6r}^lU>4Rll?^}cu_ar<=c*!t9yYB<`fDp0`iutJX{NqSc2jf>uGvK$_;zXZ}x*aIWMwm$@13Xkg%X zLgdej6Bu?7^s`gHtTet!Qu4geU0N)m>oJ%? zE9PSDB=4@s+6to7H0d*{N%<(jB&MEs73wk|C|aT1rmpzbym&Ik)K1USvvf|(_G*Rl z0xP%-S*!Rhb;H-_hP7QK09w!VNDlOqcltInjUwTr)#&!Dhx#9yJ9*;5I84&Jl*fg) ztJmnd+avvO@P?v|zFz-dFVTRY{Fh4lN|}jSZ;*y;;`!Z1MG{kJ=9k?`Cbscabl6u> z*aXQf@#h`El1>w94~EPuH<~JB#hR)Lirkauv`sN-5L5Rf=_9i1vhIWlqtp5=d)m!V zY$e+E6~wAUVQQ^IVqF}Xv1lfwa(;R#E)6*Yqa{{yFd0wsQa0=ybv`^w-y^WkuEuvf zr;d$YP1?4xUvlf%egA0mKKKd?aVyFpAk{BBx5wI{Ac0P3uWOep4j%V`(4%d+Vs2K| zo6ktwyZ7+a%v!a$f%n5)7MJl!U<9o>*yFu=W0x+^ep--h2@Su#X#8Ms`$VzaGDBf% zDqKBelW^NxuNB!ar8~?p5I{ji&6J%NTylJQq(A@18uR{bnNR5T@2&DH_h+5@G8J-S zaXzI?{T`8may>gi7kk?8G!Pd;F3JJL1R$3G7MS7sJf7dS)US)pZ*9eL57e5HPSGKx zfeMEx%z8R9Y@jZa_fHb8hlTuA0lMf~)%V6EnfgLxZCY_M9Vlg@L>!&mm=}X}(d6L} j>*!1WzEceH&7m=Z-S%&e2%Vw()d9Jye+PTp?#X`v?ptQR literal 0 HcmV?d00001 diff --git a/img/fondo.png b/img/fondo.png new file mode 100644 index 0000000000000000000000000000000000000000..daf10379b0109c026dc749030a9f2b7cd86aae8c GIT binary patch literal 11730 zcmeHtXH=8hwsz=MYD7Ar*U)R|Qlx|QCJ>SUp-b<*qY#kZoAlm61VjV`=?I8`^de0_ zP!#b-_dfgVGrs%hjPc!nJ7c`bDsw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@S$r#d5J`K2xgX&|#%YLJ+ByBJwUNt9_Ky^<6$ zPc6zglvMrEk7ckiRNBLd^&@f!JcUZ`xDCTIfOeLGlzUqF>#W)R8)xN1DWGOQ=V2Hl z16K@cGt!7$zT-iSHfa4U=Cy>oy2Kg|>?^j4JOpmFsfkme-1^N1_7xDmy2BuXCseqB z^K+F7rJeAVi1)LYEGFvBLCkiLFM^{K9)b@b=sU+2>XC7-0LZk&m1ivDkk2_)Gz z+FD(QZ)O!p6_a10KuPiCY>?MT-zMIcMH}<$i)Juct2|tBnw-3+sywww43{Z}jHO{>gV&gn`cw@6RQD-ImM0_A7MaXopSI&P;u; z|x6=LvIv8U(FaA6Dng4HSM2U*7v*rke1ao7nrwHkB9H4e9c+b^xxif>Ch;w|0!)ehPV4x+ zm;SoGyp{@dj{syBngj*y<%$P-E7DXHJ8Y7~qg1h~a|raas)UDiziMXD(!($9;WtPH zs*gH{vW21}4?~Darm6k%u(f$2LAB*3K_Aa7yIW$%I4g-t2yxT>{!%cZ!U_YKUl~6a zHo=bz)bdpGvgfh`hqxW}@z+B+G;vI0K)CBB0n_eiOyfD_(DM?YhJeAVTGFFH#yH9Q zPPA&0$3I|z$VY_jzm~mCkeUB;S*_LU+H2w3KVv(pHfZ7B7Ciopl1H9ZHPTC;$D(7F zIieG-sd5hwSnAzOxVeRFo2FL#&K*CsKT$?7@~p6t?q=q3I|2`JdkZj<#TCi6N}I+F zfEB(p5W^>_?xezX^|0hhm w-qV!d6f^rX&h;k<;Xju}IB@=LV=FS^-@AO|B}=B(YGCVTr_ZRL`h5L=0Ej$!ZU6uP literal 0 HcmV?d00001 diff --git a/lib/inspect.lua b/lib/inspect.lua new file mode 100644 index 0000000..f8d69dc --- /dev/null +++ b/lib/inspect.lua @@ -0,0 +1,337 @@ +local _tl_compat; if (tonumber((_VERSION or ''):match('[%d.]*$')) or 0) < 5.3 then local p, m = pcall(require, 'compat53.module'); if p then _tl_compat = m end end; local math = _tl_compat and _tl_compat.math or math; local string = _tl_compat and _tl_compat.string or string; local table = _tl_compat and _tl_compat.table or table +local inspect = {Options = {}, } + + + + + + + + + + + + + + + + + +inspect._VERSION = 'inspect.lua 3.1.0' +inspect._URL = 'http://github.com/kikito/inspect.lua' +inspect._DESCRIPTION = 'human-readable representations of tables' +inspect._LICENSE = [[ + MIT LICENSE + + Copyright (c) 2022 Enrique García Cota + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +]] +inspect.KEY = setmetatable({}, { __tostring = function() return 'inspect.KEY' end }) +inspect.METATABLE = setmetatable({}, { __tostring = function() return 'inspect.METATABLE' end }) + +local tostring = tostring +local rep = string.rep +local match = string.match +local char = string.char +local gsub = string.gsub +local fmt = string.format + +local function rawpairs(t) + return next, t, nil +end + + + +local function smartQuote(str) + if match(str, '"') and not match(str, "'") then + return "'" .. str .. "'" + end + return '"' .. gsub(str, '"', '\\"') .. '"' +end + + +local shortControlCharEscapes = { + ["\a"] = "\\a", ["\b"] = "\\b", ["\f"] = "\\f", ["\n"] = "\\n", + ["\r"] = "\\r", ["\t"] = "\\t", ["\v"] = "\\v", ["\127"] = "\\127", +} +local longControlCharEscapes = { ["\127"] = "\127" } +for i = 0, 31 do + local ch = char(i) + if not shortControlCharEscapes[ch] then + shortControlCharEscapes[ch] = "\\" .. i + longControlCharEscapes[ch] = fmt("\\%03d", i) + end +end + +local function escape(str) + return (gsub(gsub(gsub(str, "\\", "\\\\"), + "(%c)%f[0-9]", longControlCharEscapes), + "%c", shortControlCharEscapes)) +end + +local function isIdentifier(str) + return type(str) == "string" and not not str:match("^[_%a][_%a%d]*$") +end + +local flr = math.floor +local function isSequenceKey(k, sequenceLength) + return type(k) == "number" and + flr(k) == k and + 1 <= (k) and + k <= sequenceLength +end + +local defaultTypeOrders = { + ['number'] = 1, ['boolean'] = 2, ['string'] = 3, ['table'] = 4, + ['function'] = 5, ['userdata'] = 6, ['thread'] = 7, +} + +local function sortKeys(a, b) + local ta, tb = type(a), type(b) + + + if ta == tb and (ta == 'string' or ta == 'number') then + return (a) < (b) + end + + local dta = defaultTypeOrders[ta] or 100 + local dtb = defaultTypeOrders[tb] or 100 + + + return dta == dtb and ta < tb or dta < dtb +end + +local function getKeys(t) + + local seqLen = 1 + while rawget(t, seqLen) ~= nil do + seqLen = seqLen + 1 + end + seqLen = seqLen - 1 + + local keys, keysLen = {}, 0 + for k in rawpairs(t) do + if not isSequenceKey(k, seqLen) then + keysLen = keysLen + 1 + keys[keysLen] = k + end + end + table.sort(keys, sortKeys) + return keys, keysLen, seqLen +end + +local function countCycles(x, cycles) + if type(x) == "table" then + if cycles[x] then + cycles[x] = cycles[x] + 1 + else + cycles[x] = 1 + for k, v in rawpairs(x) do + countCycles(k, cycles) + countCycles(v, cycles) + end + countCycles(getmetatable(x), cycles) + end + end +end + +local function makePath(path, a, b) + local newPath = {} + local len = #path + for i = 1, len do newPath[i] = path[i] end + + newPath[len + 1] = a + newPath[len + 2] = b + + return newPath +end + + +local function processRecursive(process, + item, + path, + visited) + if item == nil then return nil end + if visited[item] then return visited[item] end + + local processed = process(item, path) + if type(processed) == "table" then + local processedCopy = {} + visited[item] = processedCopy + local processedKey + + for k, v in rawpairs(processed) do + processedKey = processRecursive(process, k, makePath(path, k, inspect.KEY), visited) + if processedKey ~= nil then + processedCopy[processedKey] = processRecursive(process, v, makePath(path, processedKey), visited) + end + end + + local mt = processRecursive(process, getmetatable(processed), makePath(path, inspect.METATABLE), visited) + if type(mt) ~= 'table' then mt = nil end + setmetatable(processedCopy, mt) + processed = processedCopy + end + return processed +end + +local function puts(buf, str) + buf.n = buf.n + 1 + buf[buf.n] = str +end + + + +local Inspector = {} + + + + + + + + + + +local Inspector_mt = { __index = Inspector } + +local function tabify(inspector) + puts(inspector.buf, inspector.newline .. rep(inspector.indent, inspector.level)) +end + +function Inspector:getId(v) + local id = self.ids[v] + local ids = self.ids + if not id then + local tv = type(v) + id = (ids[tv] or 0) + 1 + ids[v], ids[tv] = id, id + end + return tostring(id) +end + +function Inspector:putValue(v) + local buf = self.buf + local tv = type(v) + if tv == 'string' then + puts(buf, smartQuote(escape(v))) + elseif tv == 'number' or tv == 'boolean' or tv == 'nil' or + tv == 'cdata' or tv == 'ctype' then + puts(buf, tostring(v)) + elseif tv == 'table' and not self.ids[v] then + local t = v + + if t == inspect.KEY or t == inspect.METATABLE then + puts(buf, tostring(t)) + elseif self.level >= self.depth then + puts(buf, '{...}') + else + if self.cycles[t] > 1 then puts(buf, fmt('<%d>', self:getId(t))) end + + local keys, keysLen, seqLen = getKeys(t) + + puts(buf, '{') + self.level = self.level + 1 + + for i = 1, seqLen + keysLen do + if i > 1 then puts(buf, ',') end + if i <= seqLen then + puts(buf, ' ') + self:putValue(t[i]) + else + local k = keys[i - seqLen] + tabify(self) + if isIdentifier(k) then + puts(buf, k) + else + puts(buf, "[") + self:putValue(k) + puts(buf, "]") + end + puts(buf, ' = ') + self:putValue(t[k]) + end + end + + local mt = getmetatable(t) + if type(mt) == 'table' then + if seqLen + keysLen > 0 then puts(buf, ',') end + tabify(self) + puts(buf, ' = ') + self:putValue(mt) + end + + self.level = self.level - 1 + + if keysLen > 0 or type(mt) == 'table' then + tabify(self) + elseif seqLen > 0 then + puts(buf, ' ') + end + + puts(buf, '}') + end + + else + puts(buf, fmt('<%s %d>', tv, self:getId(v))) + end +end + + + + +function inspect.inspect(root, options) + options = options or {} + + local depth = options.depth or (math.huge) + local newline = options.newline or '\n' + local indent = options.indent or ' ' + local process = options.process + + if process then + root = processRecursive(process, root, {}, {}) + end + + local cycles = {} + countCycles(root, cycles) + + local inspector = setmetatable({ + buf = { n = 0 }, + ids = {}, + cycles = cycles, + depth = depth, + level = 0, + newline = newline, + indent = indent, + }, Inspector_mt) + + inspector:putValue(root) + + return table.concat(inspector.buf) +end + +setmetatable(inspect, { + __call = function(_, root, options) + return inspect.inspect(root, options) + end, +}) + +return inspect diff --git a/main.lua b/main.lua new file mode 100644 index 0000000..ae35f3d --- /dev/null +++ b/main.lua @@ -0,0 +1,82 @@ +require "socket" -- para o tempo en milisengundos +require("entidades/pastor") +require("entidades/ovella") +inspect = require 'lib.inspect' + +-- configuracion +OVELLAS = 6 +DISTANCIA = 70 + +function love.conf(t) + t.console = true --activa salida por consola para debug con print() +end + +-- globales +ovellas = {} + +-- inicia os recursos, execútase ó cargar o xogo +function love.load() + local width, height, flags = love.window.getMode(); + local BORDER = 100; -- pixeles de borde para non xenerar ovellas nos marxes + + -- imaxes + background = love.graphics.newImage("img/fondo.png") + cercado = love.graphics.newImage("img/cercado.png") + + -- fonte + local f = love.graphics.newFont(12) + love.graphics.setFont(f) + + -- entidades + player = Pastor:new(width/2, height/2) + + -- ovellas con posicios aleatorias + for i=1,OVELLAS do + -- print(i) + math.randomseed(os.time()+i) + local x = math.random(1 + BORDER, width - BORDER); + local y = math.random(1 + BORDER, height - BORDER); + -- print(x, y) + ovella = Ovella:new(i, x, y) + table.insert( + ovellas, + ovella + ) + end +end + +-- dibuxa +function love.draw() + -- fondo + for i = 0, love.graphics.getWidth() / background:getWidth() do + for j = 0, love.graphics.getHeight() / background:getHeight() do + love.graphics.draw(background, i * background:getWidth(), j * background:getHeight()) + end + end + + -- cercado + cercadoX = (love.graphics.getWidth() - cercado:getWidth()) / 2 + cercadoY = (love.graphics.getHeight() - cercado:getHeight()) / 2 + love.graphics.draw(cercado, cercadoX, cercadoY) + + -- pastor + player:draw() + + -- ovellas + for i = 1, #ovellas,1 do --itera sobre cada ovella na tabla + -- print(inspect(ovellas[i])) + ovellas[i]:draw() + end + + love.graphics.print("Ovellas recollidas: 0", 10, 10) +end + +function love.update(dt) + --- update player object + player:update(dt) + -- update ovella object + for i = 1, #ovellas,1 do --itera sobre cada ovella na tabla + ovellas[i]:update(player) + end + +end