From 81b042fcca45909d8e6a3a61c3fdcc256a3e48ce Mon Sep 17 00:00:00 2001 From: Randy McShandy Date: Fri, 30 Jan 2026 22:04:17 -0600 Subject: [PATCH] Rebase collision and controls for event-based control system, introduce control module + cleanup for that, and update requires for deprecation warning. --- main/assets.lua | 2 +- main/conf.lua | 31 ------ main/control.lua | 45 +++++++++ main/main.lua | 28 +++--- main/player.lua | 38 ++++---- main/tiled/test_1.lua | 216 ++++++++++++++++++++++++++++++++++++------ main/tiled/test_1.tmx | 145 ++++++++++++++++++++++------ 7 files changed, 378 insertions(+), 127 deletions(-) create mode 100644 main/control.lua diff --git a/main/assets.lua b/main/assets.lua index 2437b88..898f968 100644 --- a/main/assets.lua +++ b/main/assets.lua @@ -3,7 +3,7 @@ local utils = require('utils') local vector = require('vector') -local sti = require('plugin/sti') +local sti = require('plugin.sti') local assets = {} diff --git a/main/conf.lua b/main/conf.lua index cae69e5..a1727dc 100644 --- a/main/conf.lua +++ b/main/conf.lua @@ -13,37 +13,6 @@ config.window = fullscreen = false, } -config.ControlType = -{ - System = 0, - Movement = 1, -} - - --- I'd kind of like to keep player controls in a dedicated table that these then map into, --- but that's probably overengineering for now. Maybe a nice move for flexibility. --- Maybe even any keymapping here could describe the event(s) and params it should push. --- At some point in the future, keymaps can be switched out contextually for *very* dynamic behavior, --- like setting up menu systems. - -config.keymap = {} -config.keymap['l'] = { heading = (math.pi / 2) * -0, control = config.ControlType.Movement, } -config.keymap['k'] = { heading = (math.pi / 2) * -1, control = config.ControlType.Movement, } -config.keymap['h'] = { heading = (math.pi / 2) * -2, control = config.ControlType.Movement, } -config.keymap['j'] = { heading = (math.pi / 2) * -3, control = config.ControlType.Movement, } -config.keymap['d'] = { heading = (math.pi / 2) * -0, control = config.ControlType.Movement, } -config.keymap['w'] = { heading = (math.pi / 2) * -1, control = config.ControlType.Movement, } -config.keymap['a'] = { heading = (math.pi / 2) * -2, control = config.ControlType.Movement, } -config.keymap['s'] = { heading = (math.pi / 2) * -3, control = config.ControlType.Movement, } - -config.keymap['q'] = { - control = config.ControlType.System, - system_action = function(key) - print('Quitting') - love.event.quit() - end, -} - function love.conf(t) for k,v in pairs(config.window) do t.window[k] = v diff --git a/main/control.lua b/main/control.lua new file mode 100644 index 0000000..80aa46f --- /dev/null +++ b/main/control.lua @@ -0,0 +1,45 @@ +-- control.lua + +local player_module = require('player') + +local control = {} + +control.ControlType = +{ + System = 0, + Movement = 1, +} + +-- I'd kind of like to keep player controls in a dedicated table that these then map into, +-- but that's probably overengineering for now. Maybe a nice move for flexibility. +-- Maybe even any keymapping here could describe the event(s) and params it should push. +-- At some point in the future, keymaps can be switched out contextually for *very* dynamic behavior, +-- like setting up menu systems. + +control.keymap = {} +control.keymap['l'] = { heading = (math.pi / 2) * -0, control = control.ControlType.Movement, } +control.keymap['k'] = { heading = (math.pi / 2) * -1, control = control.ControlType.Movement, } +control.keymap['h'] = { heading = (math.pi / 2) * -2, control = control.ControlType.Movement, } +control.keymap['j'] = { heading = (math.pi / 2) * -3, control = control.ControlType.Movement, } +control.keymap['d'] = { heading = (math.pi / 2) * -0, control = control.ControlType.Movement, } +control.keymap['w'] = { heading = (math.pi / 2) * -1, control = control.ControlType.Movement, } +control.keymap['a'] = { heading = (math.pi / 2) * -2, control = control.ControlType.Movement, } +control.keymap['s'] = { heading = (math.pi / 2) * -3, control = control.ControlType.Movement, } + +control.keymap['q'] = { + control = control.ControlType.System, + system_action = function(key) + print('Quitting') + love.event.quit() + end, +} + +-- Anything interested in a movement control should register its own handler here. +function love.handlers.movement_control(key, value) + player:movement_control(key, value) +end + +function love.handlers.collision(collider, tile) +end + +return control diff --git a/main/main.lua b/main/main.lua index 92c28f0..be81b3b 100644 --- a/main/main.lua +++ b/main/main.lua @@ -1,16 +1,17 @@ -- main.lua -- Plugins -local sti = require('plugin/sti') -local lovebird = require('plugin/lovebird') -- Debugging tool http://127.0.0.1:8000 +local sti = require('plugin.sti') +local lovebird = require('plugin.lovebird') -- Debugging tool http://127.0.0.1:8000 -- Modules local conf = require('conf') local assets = require('assets') local player_module = require('player') +local control = require('control') -local active_map = nil -player = nil +active_map = nil +player = player_module.player local tx, ty function love.load() @@ -34,26 +35,23 @@ function love.update(dt) end function love.keyreleased(key) - for k,v in pairs(conf.keymap) do + for k,v in pairs(control.keymap) do if key == k then - if v.control == conf.ControlType.System then + if v.control == control.ControlType.System then v.system_action(k) end - if v.control == conf.ControlType.Movement then - love.event.push('player_control', k, v) + if v.control == control.ControlType.Movement then + love.event.push('movement_control', k, v) end end end end -function love.handlers.player_control(key, value) - if value.control == conf.ControlType.Movement then - player.vec.heading = value.heading - player.vec.speed = player.speed - end -end - function love.draw() active_map:draw(tx, ty, 2.0) + + local r,g,b,a = love.graphics.getColor() + love.graphics.setColor(love.math.colorFromBytes(54, 54, 54)) love.graphics.print(IntroMessage, math.floor((conf.window.width/16) * 1), math.floor((conf.window.height/16) * 1)) + love.graphics.setColor(r,g,b,a) end diff --git a/main/player.lua b/main/player.lua index 96684aa..e10aa2b 100644 --- a/main/player.lua +++ b/main/player.lua @@ -4,33 +4,31 @@ local conf = require('conf') local vector = require('vector') local collision = require('collision') -local player_module = {} +local player_module = { + player = nil +} function player_module.init_controls(player_obj, active_map) player_obj.speed = active_map.tilewidth - player_obj.keyreleased = function(self, key) - if key == 'q' then love.event.quit(0) end + player_obj.movement_control = function(self, key, value) + -- Calculate target tile coordinates (current tile + direction) + local current_tile_x = math.floor(self.vec.x / active_map.tilewidth) + local current_tile_y = math.floor(self.vec.y / active_map.tileheight) - for k, v in pairs(conf.player_keymap) do - if key == k and (v.control == conf.ControlType.Movement) then - -- Calculate target tile coordinates (current tile + direction) - local current_tile_x = math.floor(self.vec.x / active_map.tilewidth) - local current_tile_y = math.floor(self.vec.y / active_map.tileheight) + -- Direction vectors for each heading + local dx = math.floor(math.cos(value.heading) + 0.5) + local dy = math.floor(math.sin(value.heading) + 0.5) - -- Direction vectors for each heading - local dx = math.floor(math.cos(v.heading) + 0.5) - local dy = math.floor(math.sin(v.heading) + 0.5) + local target_tile_x = current_tile_x + dx + local target_tile_y = current_tile_y + dy - local target_tile_x = current_tile_x + dx - local target_tile_y = current_tile_y + dy - - if not collision.is_tile_collidable(active_map, target_tile_x + 1, target_tile_y + 1) then - -- Move to target tile (convert back to world coordinates) - self.vec.x = target_tile_x * active_map.tilewidth - self.vec.y = target_tile_y * active_map.tileheight - end - end + if not collision.is_tile_collidable(active_map, target_tile_x + 1, target_tile_y + 1) then + -- Move to target tile (convert back to world coordinates) + self.vec.x = target_tile_x * active_map.tilewidth + self.vec.y = target_tile_y * active_map.tileheight + else + love.event.push('collision', player_module.player, { x = current_tile_x + 1, y = current_tile_y + 1 }) end end end diff --git a/main/tiled/test_1.lua b/main/tiled/test_1.lua index 2116803..8af5fff 100644 --- a/main/tiled/test_1.lua +++ b/main/tiled/test_1.lua @@ -9,8 +9,8 @@ return { height = 20, tilewidth = 16, tileheight = 16, - nextlayerid = 5, - nextobjectid = 10, + nextlayerid = 7, + nextobjectid = 13, properties = {}, tilesets = { { @@ -83,9 +83,169 @@ return { } } } + }, + { + name = "monochrome_bw_packed", + firstgid = 2157, + class = "", + tilewidth = 16, + tileheight = 16, + spacing = 0, + margin = 0, + columns = 49, + image = "../assets/tilesets/kenney_1_bit/Tilesheet/monochrome_bw_packed.png", + imagewidth = 784, + imageheight = 352, + objectalignment = "unspecified", + tilerendersize = "tile", + fillmode = "stretch", + tileoffset = { + x = 0, + y = 0 + }, + grid = { + orientation = "orthogonal", + width = 16, + height = 16 + }, + properties = {}, + wangsets = {}, + tilecount = 1078, + tiles = { + { + id = 49, + properties = { + ["wall"] = true + } + }, + { + id = 50, + properties = { + ["wall"] = true + } + }, + { + id = 51, + properties = { + ["wall"] = true + } + }, + { + id = 52, + properties = { + ["wall"] = true + } + }, + { + id = 53, + properties = { + ["wall"] = true + } + }, + { + id = 54, + properties = { + ["wall"] = true + } + }, + { + id = 204, + properties = { + ["wall"] = true + } + }, + { + id = 205, + properties = { + ["wall"] = true + } + }, + { + id = 206, + properties = { + ["wall"] = true + } + }, + { + id = 207, + properties = { + ["wall"] = true + } + }, + { + id = 208, + properties = { + ["wall"] = true + } + }, + { + id = 253, + properties = { + ["wall"] = true + } + }, + { + id = 254, + properties = { + ["wall"] = true + } + }, + { + id = 255, + properties = { + ["wall"] = true + } + }, + { + id = 256, + properties = { + ["wall"] = true + } + } + } } }, layers = { + { + type = "tilelayer", + x = 0, + y = 0, + width = 30, + height = 20, + id = 6, + name = "Background", + class = "", + visible = true, + opacity = 1, + offsetx = 0, + offsety = 0, + parallaxx = 1, + parallaxy = 1, + properties = {}, + encoding = "lua", + data = { + 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, + 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, + 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, + 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, + 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, + 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, + 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, + 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, + 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, + 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, + 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, + 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, + 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, + 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, + 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, + 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, + 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, + 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, + 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, + 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157, 2157 + } + }, { type = "tilelayer", x = 0, @@ -93,7 +253,7 @@ return { width = 30, height = 20, id = 1, - name = "Tile Layer 1", + name = "Decoration", class = "", visible = true, opacity = 1, @@ -101,31 +261,29 @@ return { offsety = 0, parallaxx = 1, parallaxy = 1, - properties = { - ["wall"] = true - }, + properties = {}, encoding = "lua", data = { - 1129, 869, 870, 871, 872, 873, 874, 875, 876, 877, 878, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, - 918, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 51, - 919, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 51, - 920, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 51, - 921, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 51, - 922, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 746, 747, 748, 1, 1, 1, 1, 1, 1, 1, 1, 51, - 923, 1, 1, 1, 1, 1, 1, 206, 2684354765, 2684354765, 2684354765, 2684354765, 2684354765, 2684354766, 1, 1, 1, 1, 795, 796, 797, 1, 1, 1, 1, 1, 1, 1, 1, 51, - 924, 1, 1, 1, 1, 1, 1, 205, 1, 1, 1, 1, 1, 205, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 51, - 925, 1, 1, 1, 1, 1, 1, 205, 206, 2684354765, 2684354765, 2684354765, 2684354766, 205, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 51, - 926, 1, 1, 1, 1, 1, 1, 205, 205, 1, 209, 1, 205, 205, 1, 1, 1, 1, 1, 1, 19, 21, 19, 21, 1, 1, 1, 1, 1, 51, - 927, 1, 1, 1, 1, 1, 1, 205, 1610612942, 2684354765, 208, 2684354765, 3221225678, 205, 1, 1, 1, 1, 1, 1, 117, 119, 117, 119, 1, 1, 1, 1, 1, 51, - 928, 1, 1, 1, 1, 1, 1, 205, 1, 1, 3221225677, 1, 1, 205, 1, 1, 1, 1, 1, 1, 19, 21, 19, 21, 1, 1, 1, 1, 1, 51, - 1129, 1, 1, 1, 1, 1, 1, 1610612942, 2684354765, 2684354765, 1610612943, 2684354765, 2684354765, 3221225678, 1, 1, 1, 1, 1, 1, 117, 119, 117, 119, 1, 1, 1, 1, 1, 51, - 1129, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 51, - 1129, 1, 1129, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 51, - 1129, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 51, - 1129, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 51, - 1129, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 51, - 1129, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 51, - 1129, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51 + 2207, 3025, 3026, 3027, 3028, 3029, 3030, 3031, 3032, 3033, 3034, 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207, + 3074, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2207, + 3075, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2207, + 3076, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2207, + 3077, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2207, + 3078, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2902, 2903, 2904, 0, 0, 0, 0, 0, 0, 0, 0, 2207, + 3079, 0, 0, 0, 0, 0, 0, 2362, 2684356921, 1610615097, 2684356921, 1610615097, 2684356921, 2684356922, 0, 0, 0, 0, 2951, 2952, 2953, 0, 0, 0, 0, 0, 0, 0, 0, 2207, + 3080, 0, 0, 0, 0, 0, 0, 3221227833, 0, 0, 0, 0, 0, 2361, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2207, + 3081, 0, 0, 0, 0, 0, 0, 2361, 2362, 1610615097, 2684356921, 1610615097, 2684356922, 3221227833, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2207, + 3082, 0, 0, 0, 0, 0, 0, 3221227833, 2361, 0, 2365, 0, 2361, 2361, 0, 0, 0, 0, 0, 0, 2175, 2177, 2175, 2177, 0, 0, 0, 0, 0, 2207, + 3083, 0, 0, 0, 0, 0, 0, 2361, 1610615098, 1610615097, 1610615100, 2684356921, 3221227834, 3221227833, 0, 0, 0, 0, 0, 0, 2273, 2275, 2273, 2275, 0, 0, 0, 0, 0, 2207, + 3084, 0, 0, 0, 0, 0, 0, 3221227833, 0, 0, 2361, 0, 0, 2361, 0, 0, 0, 0, 0, 0, 2175, 2177, 2175, 2177, 0, 0, 0, 0, 0, 2207, + 2207, 0, 0, 0, 0, 0, 0, 1610615098, 1610615097, 2684356921, 1610615099, 2684356921, 1610615097, 3221227834, 0, 0, 0, 0, 0, 0, 2273, 2275, 2273, 2275, 0, 0, 0, 0, 0, 2207, + 2207, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2207, + 2207, 0, 2207, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2207, + 2207, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2207, + 2207, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2207, + 2207, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2207, + 2207, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2207, + 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207 } }, { @@ -143,16 +301,16 @@ return { properties = {}, objects = { { - id = 2, + id = 11, name = "Player", type = "", shape = "rectangle", x = 48, - y = 160, + y = 144, width = 16, height = 16, rotation = 0, - gid = 515, + gid = 2671, visible = true, properties = {} } diff --git a/main/tiled/test_1.tmx b/main/tiled/test_1.tmx index 493aef9..869e646 100644 --- a/main/tiled/test_1.tmx +++ b/main/tiled/test_1.tmx @@ -1,13 +1,10 @@ - + - - - - - + + @@ -18,35 +15,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 + + + -1129,869,870,871,872,873,874,875,876,877,878,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51, -918,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,51, -919,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,51, -920,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,51, -921,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,51, -922,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,746,747,748,1,1,1,1,1,1,1,1,51, -923,1,1,1,1,1,1,206,2684354765,2684354765,2684354765,2684354765,2684354765,2684354766,1,1,1,1,795,796,797,1,1,1,1,1,1,1,1,51, -924,1,1,1,1,1,1,205,1,1,1,1,1,205,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,51, -925,1,1,1,1,1,1,205,206,2684354765,2684354765,2684354765,2684354766,205,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,51, -926,1,1,1,1,1,1,205,205,1,209,1,205,205,1,1,1,1,1,1,19,21,19,21,1,1,1,1,1,51, -927,1,1,1,1,1,1,205,1610612942,2684354765,208,2684354765,3221225678,205,1,1,1,1,1,1,117,119,117,119,1,1,1,1,1,51, -928,1,1,1,1,1,1,205,1,1,3221225677,1,1,205,1,1,1,1,1,1,19,21,19,21,1,1,1,1,1,51, -1129,1,1,1,1,1,1,1610612942,2684354765,2684354765,1610612943,2684354765,2684354765,3221225678,1,1,1,1,1,1,117,119,117,119,1,1,1,1,1,51, -1129,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,51, -1129,1,1129,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,51, -1129,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,51, -1129,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,51, -1129,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,51, -1129,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,51, -1129,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51 +51,869,870,871,872,873,874,875,876,877,878,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51, +918,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,51, +919,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,51, +920,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,51, +921,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,51, +922,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,746,747,748,0,0,0,0,0,0,0,0,51, +923,0,0,0,0,0,0,206,2684354765,1610612941,2684354765,1610612941,2684354765,2684354766,0,0,0,0,795,796,797,0,0,0,0,0,0,0,0,51, +924,0,0,0,0,0,0,3221225677,0,0,0,0,0,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,51, +925,0,0,0,0,0,0,205,206,1610612941,2684354765,1610612941,2684354766,3221225677,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,51, +926,0,0,0,0,0,0,3221225677,205,0,209,0,205,205,0,0,0,0,0,0,19,21,19,21,0,0,0,0,0,51, +927,0,0,0,0,0,0,205,1610612942,1610612941,1610612944,2684354765,3221225678,3221225677,0,0,0,0,0,0,117,119,117,119,0,0,0,0,0,51, +928,0,0,0,0,0,0,3221225677,0,0,205,0,0,205,0,0,0,0,0,0,19,21,19,21,0,0,0,0,0,51, +51,0,0,0,0,0,0,1610612942,1610612941,2684354765,1610612943,2684354765,1610612941,3221225678,0,0,0,0,0,0,117,119,117,119,0,0,0,0,0,51, +51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,51, +51,0,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,51, +51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,51, +51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,51, +51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,51, +51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,51, +51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51 - + -- 2.49.0