diff options
-rw-r--r-- | assets/images/aswani.png | bin | 0 -> 2793 bytes | |||
-rw-r--r-- | assets/images/enemy.png | bin | 0 -> 3567 bytes | |||
-rw-r--r-- | assets/images/player_demo.png | bin | 138 -> 133 bytes | |||
-rw-r--r-- | assets/images/tileset.png | bin | 3011 -> 3108 bytes | |||
-rw-r--r-- | assets/maps/level1.lua | 338 | ||||
-rw-r--r-- | conf.lua | 3 | ||||
-rw-r--r-- | core/map.lua | 47 | ||||
-rw-r--r-- | entities/enemy.lua | 33 | ||||
-rw-r--r-- | main.lua | 9 | ||||
-rw-r--r-- | raw/level1.png | bin | 0 -> 14204 bytes | |||
-rw-r--r-- | raw/level1.tmx | 107 | ||||
-rw-r--r-- | raw/tileset.aseprite | bin | 1862 -> 2002 bytes | |||
-rw-r--r-- | scenes/level1_scene.lua | 12 | ||||
-rw-r--r-- | scenes/menu_scene.lua | 10 |
14 files changed, 479 insertions, 80 deletions
diff --git a/assets/images/aswani.png b/assets/images/aswani.png Binary files differnew file mode 100644 index 0000000..aca4344 --- /dev/null +++ b/assets/images/aswani.png diff --git a/assets/images/enemy.png b/assets/images/enemy.png Binary files differnew file mode 100644 index 0000000..51ed5a0 --- /dev/null +++ b/assets/images/enemy.png diff --git a/assets/images/player_demo.png b/assets/images/player_demo.png Binary files differindex dfa3f59..314aec1 100644 --- a/assets/images/player_demo.png +++ b/assets/images/player_demo.png diff --git a/assets/images/tileset.png b/assets/images/tileset.png Binary files differindex 3d95459..79d57eb 100644 --- a/assets/images/tileset.png +++ b/assets/images/tileset.png diff --git a/assets/maps/level1.lua b/assets/maps/level1.lua index fc68b04..12f04ef 100644 --- a/assets/maps/level1.lua +++ b/assets/maps/level1.lua @@ -8,8 +8,8 @@ return { height = 32, tilewidth = 16, tileheight = 16, - nextlayerid = 7, - nextobjectid = 47, + nextlayerid = 8, + nextobjectid = 73, properties = {}, tilesets = { { @@ -105,7 +105,21 @@ return { } }, tilecount = 1024, - tiles = {} + tiles = { + { + id = 8, + animation = { + { + tileid = 8, + duration = 1000 + }, + { + tileid = 9, + duration = 1000 + } + } + } + } } }, layers = { @@ -115,6 +129,57 @@ return { y = 0, width = 32, height = 32, + id = 7, + name = "water", + visible = true, + opacity = 1, + offsetx = 0, + offsety = 0, + parallaxx = 1, + parallaxy = 1, + properties = {}, + encoding = "lua", + data = { + 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, 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, 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, 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, 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, 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, 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, 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, + 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, 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, 9, 0, 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 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + }, + { + type = "tilelayer", + x = 0, + y = 0, + width = 32, + height = 32, id = 1, name = "ground", visible = true, @@ -132,29 +197,29 @@ return { 6, 7, 7, 6, 0, 0, 7, 6, 6, 6, 0, 0, 8, 8, 0, 0, 0, 0, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 6, 6, 6, 7, 7, 6, 163, 165, 6, 6, 6, 6, 6, 0, 0, 7, 7, 0, 163, 165, 8, 8, 0, 7, 8, 8, 7, 8, 8, 8, 8, 8, 8, 6, 6, 7, 7, 6, 195, 197, 6, 6, 6, 7, 6, 6, 0, 8, 7, 0, 195, 197, 8, 8, 0, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 6, - 6, 7, 6, 6, 195, 197, 0, 6, 6, 6, 8, 8, 8, 8, 7, 7, 195, 197, 0, 8, 8, 7, 7, 7, 7, 7, 7, 8, 0, 8, 0, 6, - 6, 6, 0, 0, 195, 197, 8, 7, 7, 8, 8, 8, 8, 7, 0, 7, 195, 197, 8, 8, 8, 8, 8, 8, 8, 7, 7, 7, 8, 8, 0, 6, - 6, 6, 6, 0, 195, 197, 8, 8, 7, 7, 7, 7, 7, 7, 7, 7, 195, 197, 0, 8, 8, 8, 8, 8, 7, 8, 8, 8, 8, 8, 0, 6, - 6, 6, 6, 7, 195, 193, 165, 0, 8, 8, 7, 7, 7, 7, 7, 0, 195, 197, 7, 7, 8, 8, 8, 8, 8, 8, 8, 7, 8, 0, 7, 6, - 6, 6, 6, 6, 227, 162, 197, 0, 0, 0, 0, 0, 0, 0, 0, 0, 195, 197, 8, 7, 7, 8, 8, 8, 8, 8, 7, 7, 8, 7, 7, 6, - 6, 6, 7, 0, 0, 195, 193, 164, 164, 164, 164, 164, 164, 164, 164, 164, 194, 197, 8, 7, 7, 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 6, - 6, 6, 7, 7, 7, 227, 228, 228, 228, 228, 162, 161, 228, 228, 228, 228, 228, 229, 7, 7, 8, 7, 8, 8, 0, 7, 0, 8, 8, 7, 0, 6, - 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 195, 197, 8, 6, 6, 8, 8, 8, 7, 7, 8, 7, 8, 7, 7, 7, 7, 7, 7, 7, 7, 6, - 6, 0, 7, 7, 7, 7, 163, 164, 165, 7, 195, 197, 6, 6, 6, 6, 6, 6, 7, 8, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 6, 0, 7, 7, 6, 163, 194, 196, 197, 6, 195, 197, 6, 6, 6, 6, 6, 6, 163, 164, 164, 165, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 6, 0, 7, 6, 6, 195, 196, 196, 193, 165, 195, 197, 6, 6, 6, 6, 163, 164, 194, 196, 196, 193, 165, 7, 7, 0, 0, 0, 0, 7, 7, 6, - 6, 7, 7, 6, 6, 227, 162, 196, 196, 193, 194, 193, 164, 164, 164, 164, 194, 196, 196, 196, 196, 196, 197, 7, 7, 0, 0, 0, 0, 0, 6, 6, - 6, 7, 7, 7, 7, 163, 194, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 161, 229, 7, 7, 7, 7, 7, 7, 7, 6, 6, - 6, 7, 7, 7, 6, 195, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 193, 165, 7, 7, 7, 7, 7, 0, 0, 6, 6, - 6, 7, 7, 7, 6, 227, 228, 162, 196, 161, 162, 196, 196, 196, 196, 196, 196, 196, 196, 196, 161, 228, 229, 7, 0, 7, 7, 0, 0, 6, 6, 6, - 6, 7, 7, 7, 7, 7, 7, 227, 228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, 8, 8, 8, 0, 6, + 6, 6, 6, 7, 195, 193, 165, 0, 8, 8, 7, 7, 7, 7, 7, 0, 195, 197, 7, 163, 194, 161, 162, 197, 227, 162, 197, 7, 8, 0, 7, 6, + 6, 6, 6, 6, 227, 162, 197, 0, 0, 0, 0, 0, 0, 0, 0, 0, 195, 193, 164, 194, 161, 229, 195, 197, 8, 195, 197, 7, 8, 7, 7, 6, + 6, 6, 7, 0, 0, 195, 193, 164, 164, 164, 164, 164, 164, 164, 164, 164, 194, 196, 196, 196, 193, 165, 227, 229, 165, 195, 197, 7, 7, 7, 7, 6, + 6, 6, 7, 7, 7, 227, 228, 228, 228, 228, 162, 161, 228, 228, 228, 228, 162, 196, 196, 196, 196, 193, 164, 194, 193, 194, 197, 8, 8, 7, 0, 6, + 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 195, 197, 8, 6, 6, 8, 195, 196, 196, 196, 196, 196, 196, 196, 196, 196, 197, 7, 7, 7, 7, 6, + 6, 0, 7, 7, 7, 7, 163, 164, 165, 7, 195, 197, 6, 6, 6, 6, 227, 228, 162, 196, 196, 196, 196, 196, 196, 196, 197, 7, 7, 7, 7, 7, + 6, 0, 7, 7, 6, 163, 194, 196, 197, 6, 195, 197, 6, 6, 6, 163, 164, 164, 194, 196, 196, 161, 228, 228, 162, 196, 197, 7, 7, 7, 7, 7, + 6, 0, 7, 6, 6, 195, 196, 196, 193, 165, 195, 197, 6, 6, 163, 194, 196, 196, 196, 196, 196, 193, 165, 7, 195, 196, 193, 165, 0, 7, 7, 6, + 6, 7, 7, 6, 6, 227, 162, 196, 196, 193, 194, 193, 164, 164, 194, 196, 196, 196, 196, 196, 196, 196, 193, 164, 194, 196, 196, 197, 0, 0, 6, 6, + 6, 7, 7, 7, 163, 164, 194, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 197, 7, 7, 6, 6, + 6, 7, 7, 7, 195, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 161, 228, 228, 228, 229, 0, 0, 6, 6, + 6, 7, 7, 7, 195, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 197, 0, 7, 7, 0, 0, 6, 6, 6, + 6, 7, 7, 7, 195, 196, 196, 196, 196, 196, 161, 228, 228, 162, 196, 161, 228, 228, 228, 162, 196, 196, 196, 197, 7, 7, 7, 7, 6, 6, 0, 6, + 6, 7, 7, 7, 195, 196, 196, 196, 196, 196, 197, 7, 6, 195, 196, 197, 0, 7, 163, 194, 196, 196, 196, 197, 7, 7, 7, 7, 6, 6, 7, 6, + 6, 7, 7, 7, 195, 196, 196, 196, 196, 196, 193, 164, 164, 194, 196, 193, 164, 164, 194, 196, 161, 162, 161, 229, 7, 7, 7, 6, 6, 0, 0, 6, + 7, 7, 7, 7, 195, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 197, 227, 229, 0, 0, 0, 7, 6, 7, 0, 0, 6, + 0, 0, 6, 6, 195, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 197, 7, 0, 0, 0, 0, 6, 7, 0, 0, 0, 6, + 7, 7, 0, 7, 227, 162, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 161, 229, 7, 0, 7, 7, 7, 6, 7, 7, 7, 0, 6, + 7, 7, 0, 7, 7, 227, 228, 228, 228, 228, 228, 162, 196, 161, 228, 228, 228, 228, 228, 229, 7, 7, 7, 7, 7, 7, 6, 6, 6, 7, 7, 6, + 7, 8, 8, 8, 7, 7, 7, 8, 8, 7, 7, 227, 228, 229, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 7, 6, 6, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 0, 6, 6, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 0, 0, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 0, 0, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6 @@ -529,6 +594,227 @@ return { rotation = 0, visible = true, properties = {} + }, + { + id = 55, + name = "", + type = "", + shape = "rectangle", + x = 346.75, + y = 155, + width = 11, + height = 40.25, + rotation = 0, + visible = true, + properties = {} + }, + { + id = 56, + name = "", + type = "", + shape = "rectangle", + x = 330.75, + y = 170.75, + width = 14.25, + height = 8.5, + rotation = 0, + visible = true, + properties = {} + }, + { + id = 57, + name = "", + type = "", + shape = "rectangle", + x = 358.75, + y = 186.75, + width = 26.5, + height = 9, + rotation = 0, + visible = true, + properties = {} + }, + { + id = 58, + name = "", + type = "", + shape = "rectangle", + x = 379.25, + y = 140.5, + width = 8.25, + height = 36.75, + rotation = 0, + visible = true, + properties = {} + }, + { + id = 59, + name = "", + type = "", + shape = "rectangle", + x = 387.75, + y = 155, + width = 15, + height = 23, + rotation = 0, + visible = true, + properties = {} + }, + { + id = 60, + name = "", + type = "", + shape = "rectangle", + x = 395, + y = 178.5, + width = 8.5, + height = 16.5, + rotation = 0, + visible = true, + properties = {} + }, + { + id = 61, + name = "", + type = "", + shape = "rectangle", + x = 379.5, + y = 178, + width = 5, + height = 7.75, + rotation = 0, + visible = true, + properties = {} + }, + { + id = 62, + name = "", + type = "", + shape = "rectangle", + x = 188.909, + y = 203.818, + width = 36.1818, + height = 70.5455, + rotation = 0, + visible = true, + properties = {} + }, + { + id = 64, + name = "", + type = "", + shape = "rectangle", + x = 225.818, + y = 203.455, + width = 16.7273, + height = 55.0909, + rotation = 0, + visible = true, + properties = {} + }, + { + id = 65, + name = "", + type = "", + shape = "rectangle", + x = 242.909, + y = 203.636, + width = 16, + height = 39.6364, + rotation = 0, + visible = true, + properties = {} + }, + { + id = 66, + name = "", + type = "", + shape = "rectangle", + x = 260.182, + y = 234.727, + width = 30.9091, + height = 8.90909, + rotation = 0, + visible = true, + properties = {} + }, + { + id = 67, + name = "", + type = "", + shape = "rectangle", + x = 173, + y = 346.333, + width = 36, + height = 23, + rotation = 0, + visible = true, + properties = {} + }, + { + id = 68, + name = "", + type = "", + shape = "rectangle", + x = 253, + y = 347, + width = 36.3333, + height = 23.3333, + rotation = 0, + visible = true, + properties = {} + }, + { + id = 69, + name = "", + type = "", + shape = "rectangle", + x = 290.333, + y = 348, + width = 16.6667, + height = 7.33333, + rotation = 0, + visible = true, + properties = {} + }, + { + id = 70, + name = "", + type = "", + shape = "rectangle", + x = 347.636, + y = 250.727, + width = 40.7273, + height = 7.81818, + rotation = 0, + visible = true, + properties = {} + }, + { + id = 71, + name = "", + type = "", + shape = "rectangle", + x = 363.455, + y = 259.636, + width = 24.7273, + height = 15.0909, + rotation = 0, + visible = true, + properties = {} + }, + { + id = 72, + name = "", + type = "", + shape = "rectangle", + x = 182, + y = 356.364, + width = 14.3636, + height = 3.63636, + rotation = 0, + visible = true, + properties = {} } } } @@ -5,5 +5,4 @@ function love.conf(t) t.window.title = "<Your Enemy is in Another Dungeon>" t.window.usedpiscale = true t.window.icon = "assets/images/icon.png" - t.console = true -end
\ No newline at end of file +end diff --git a/core/map.lua b/core/map.lua index f64d3f7..e6732ee 100644 --- a/core/map.lua +++ b/core/map.lua @@ -8,13 +8,15 @@ require("libs.tserial") require("core.notifications") require("entities.enemy") require("entities.pickable") +anim8 = require("libs.anim8.anim8") local zoomFactor = 3 local player = { x=0, y=0, sprite=love.graphics.newImage("assets/images/player_demo.png"), - speed=100, - dir="down" + speed=70, + dir="down", + spriteSheet= love.graphics.newImage("assets/images/aswani.png") } local fullscreen = true @@ -26,6 +28,7 @@ Map = Class { __include=Gamestate, init = function(self, mapName, debug) self.debug = debug and debug or false + initAnimations() _gameWorld = Windfield.newWorld(0,0) _gameWorld:setQueryDebugDrawing(debug and debug or false) -- Remove when deploy _gameWorld:addCollisionClass('interactive') @@ -51,7 +54,7 @@ Map = Class { if obj.name=="player" and obj.type=="player" then player.x = obj.x player.y = obj.y - player.collider = _gameWorld:newBSGRectangleCollider(player.x, player.y, 8, 8, 0) + player.collider = _gameWorld:newBSGRectangleCollider(player.x, player.y, 16, 16, 0) player.collider:setFixedRotation(true) player.collider:setCollisionClass('player') @@ -101,32 +104,41 @@ Map = Class { function Map:update(dt) local vx = 0 local vy = 0 - + local isMoving = false if love.keyboard.isDown("w") then vy = player.speed * -1 - player.dir = "up" + player.dir = player.animations.up + isMoving = true end if love.keyboard.isDown("a") then vx = player.speed * -1 - player.dir = "left" + player.dir = player.animations.left + isMoving = true end if love.keyboard.isDown("s") then vy = player.speed - player.dir = "down" + player.dir = player.animations.down + isMoving = true end if love.keyboard.isDown("d") then vx = player.speed - player.dir = "right" + player.dir = player.animations.right + isMoving = true + end + + if isMoving == false then + player.dir:gotoFrame(2) end + player.dir:update(dt) player.collider:setLinearVelocity(vx, vy) _gameWorld:update(dt) - player.x = player.collider:getX() - 4 - player.y = player.collider:getY() - 4 + player.x = player.collider:getX() - 8 + player.y = player.collider:getY() - 8 player.collider:setObject(player) camera:lookAt(player.x, player.y) @@ -181,9 +193,11 @@ end function Map:draw() effect(function() camera:attach() + drawMapLayer("water") drawMapLayer("ground") drawMapLayer("decorations") - love.graphics.draw(player.sprite, player.x, player.y) + --love.graphics.draw(player.sprite, player.x, player.y) + player.dir:draw(player.spriteSheet, player.x, player.y, nil, 0.5, 0.5) drawMapLayer("foreground") if self.debug then _gameWorld:draw() -- Debug Collision Draw @@ -225,4 +239,15 @@ function resize() notifications.calculateWindowDimensions() end +function initAnimations() + player.grid=anim8.newGrid(32,32,player.spriteSheet:getWidth(), player.spriteSheet:getHeight()) + + player.animations = {} + player.animations.down = anim8.newAnimation(player.grid('1-3', 1),0.1) + player.animations.left = anim8.newAnimation(player.grid('1-3', 2),0.1) + player.animations.right = anim8.newAnimation(player.grid('1-3', 3),0.1) + player.animations.up = anim8.newAnimation(player.grid('1-3', 4),0.1) + player.dir = player.animations.down +end + return Map diff --git a/entities/enemy.lua b/entities/enemy.lua index f8f0681..b440b41 100644 --- a/entities/enemy.lua +++ b/entities/enemy.lua @@ -1,10 +1,20 @@ Class = require("libs.hump.class") require("libs.tserial") +anim8 = require("libs.anim8.anim8") Enemy = Class{ init = function(self, x, y, gameWorld) self.x = x self.y = y self.world = gameWorld + self.grid=anim8.newGrid(32,32,self.spriteSheet:getWidth(), self.spriteSheet:getHeight()) + + self.animations = {} + self.animations.down = anim8.newAnimation(self.grid('1-3', 1),0.1) + self.animations.left = anim8.newAnimation(self.grid('1-3', 2),0.1) + self.animations.right = anim8.newAnimation(self.grid('1-3', 3),0.1) + self.animations.up = anim8.newAnimation(self.grid('1-3', 4),0.1) + self.dir = self.animations.down + print(self.dir) end, x=0, y=0, @@ -12,12 +22,16 @@ Enemy = Class{ collider=nil, world=nil, chasing=false, - dead=false + dead=false, + dir="down", + spriteSheet= love.graphics.newImage("assets/images/enemy.png"), + animations = {}, + grid=nil } function Enemy:draw() love.graphics.setColor({1,0,0}) - love.graphics.rectangle('fill', self.x, self.y, 8, 8) + self.dir:draw(self.spriteSheet, self.x, self.y, nil, 0.5, 0.5) if self.collider then end @@ -27,19 +41,26 @@ function Enemy:setCollider() self.collider = self.world:newRectangleCollider(self.x, self.y, 8, 8) self.collider:setFixedRotation(true) self.collider:setType('static') + self.collider:setCollisionClass('enemy') end function Enemy:update(dt) + if self.chasing == false then + self.dir:gotoFrame(2) + end + self.dir:update(dt) if self.collider then local playerColliders = self.world:queryCircleArea(self.x, self.y, 100,{'player'}) local enemyColliders = self.world:queryCircleArea(self.x+4, self.y+4, 8,{'enemy'}) - if #playerColliders then + if #playerColliders > 0 then self.chasing = true for i,collider in pairs(playerColliders) do local playerObject = collider:getObject() directionX = playerObject.x - self.x directionY = playerObject.y - self.y + local angle = math.atan2(directionX,directionY) + print((angle*180)/3.14) distance = math.sqrt(directionX * directionX + directionY * directionY) local angle = math.atan2(directionY, directionX) if distance > 20 then @@ -51,8 +72,8 @@ function Enemy:update(dt) end if self.collider then - self.collider:setX(self.x+4) - self.collider:setY(self.y+4) + self.collider:setX(self.x+8) + self.collider:setY(self.y+8) end else @@ -64,4 +85,4 @@ function Enemy:update(dt) self.collider:destroy() end end -end
\ No newline at end of file +end @@ -4,8 +4,9 @@ require("scenes.menu_scene"); require("scenes.level1_scene"); function love.load() - -- initGame() - bypassMenu() + initGame() + love.graphics.setDefaultFilter("nearest", "nearest") + --bypassMenu() end function bypassMenu() @@ -39,6 +40,6 @@ end function love.keyreleased(key, scancode) -- Temporary if scancode == 'escape' then - love.event.quit() + love.event.quit() end -end
\ No newline at end of file +end diff --git a/raw/level1.png b/raw/level1.png Binary files differnew file mode 100644 index 0000000..9a1bf89 --- /dev/null +++ b/raw/level1.png diff --git a/raw/level1.tmx b/raw/level1.tmx index 3b69392..78258a8 100644 --- a/raw/level1.tmx +++ b/raw/level1.tmx @@ -1,10 +1,16 @@ <?xml version="1.0" encoding="UTF-8"?> -<map version="1.8" tiledversion="1.8.2" orientation="orthogonal" renderorder="right-down" width="32" height="32" tilewidth="16" tileheight="16" infinite="0" nextlayerid="7" nextobjectid="47"> +<map version="1.8" tiledversion="1.8.2" orientation="orthogonal" renderorder="right-down" width="32" height="32" tilewidth="16" tileheight="16" infinite="0" nextlayerid="8" nextobjectid="73"> <editorsettings> <export target="../assets/maps/level1.lua" format="lua"/> </editorsettings> <tileset firstgid="1" name="tileset" tilewidth="16" tileheight="16" tilecount="1024" columns="32"> <image source="../assets/images/tileset.png" width="512" height="512"/> + <tile id="8"> + <animation> + <frame tileid="8" duration="1000"/> + <frame tileid="9" duration="1000"/> + </animation> + </tile> <wangsets> <wangset name="white_path" type="mixed" tile="-1"> <wangcolor name="whitePath_terrain" color="#ff0000" tile="-1" probability="1"/> @@ -24,6 +30,42 @@ </wangset> </wangsets> </tile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, +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,0,0,0,0 +</data> + </layer> <layer id="1" name="ground" width="32" height="32"> <data encoding="csv"> 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, @@ -32,29 +74,29 @@ 6,7,7,6,0,0,7,6,6,6,0,0,8,8,0,0,0,0,8,8,8,8,8,8,8,8,8,8,8,8,6,6, 6,7,7,6,163,165,6,6,6,6,6,0,0,7,7,0,163,165,8,8,0,7,8,8,7,8,8,8,8,8,8,6, 6,7,7,6,195,197,6,6,6,7,6,6,0,8,7,0,195,197,8,8,0,7,7,7,7,7,7,8,8,8,8,6, -6,7,6,6,195,197,0,6,6,6,8,8,8,8,7,7,195,197,0,8,8,7,7,7,7,7,7,8,0,8,0,6, -6,6,0,0,195,197,8,7,7,8,8,8,8,7,0,7,195,197,8,8,8,8,8,8,8,7,7,7,8,8,0,6, -6,6,6,0,195,197,8,8,7,7,7,7,7,7,7,7,195,197,0,8,8,8,8,8,7,8,8,8,8,8,0,6, -6,6,6,7,195,193,165,0,8,8,7,7,7,7,7,0,195,197,7,7,8,8,8,8,8,8,8,7,8,0,7,6, -6,6,6,6,227,162,197,0,0,0,0,0,0,0,0,0,195,197,8,7,7,8,8,8,8,8,7,7,8,7,7,6, -6,6,7,0,0,195,193,164,164,164,164,164,164,164,164,164,194,197,8,7,7,8,8,8,8,8,8,7,7,7,7,6, -6,6,7,7,7,227,228,228,228,228,162,161,228,228,228,228,228,229,7,7,8,7,8,8,0,7,0,8,8,7,0,6, -6,6,7,7,7,7,7,7,7,7,195,197,8,6,6,8,8,8,7,7,8,7,8,7,7,7,7,7,7,7,7,6, -6,0,7,7,7,7,163,164,165,7,195,197,6,6,6,6,6,6,7,8,7,7,7,7,7,7,7,7,7,7,7,7, -6,0,7,7,6,163,194,196,197,6,195,197,6,6,6,6,6,6,163,164,164,165,7,7,7,7,7,7,7,7,7,7, -6,0,7,6,6,195,196,196,193,165,195,197,6,6,6,6,163,164,194,196,196,193,165,7,7,0,0,0,0,7,7,6, -6,7,7,6,6,227,162,196,196,193,194,193,164,164,164,164,194,196,196,196,196,196,197,7,7,0,0,0,0,0,6,6, -6,7,7,7,7,163,194,196,196,196,196,196,196,196,196,196,196,196,196,196,196,161,229,7,7,7,7,7,7,7,6,6, -6,7,7,7,6,195,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,193,165,7,7,7,7,7,0,0,6,6, -6,7,7,7,6,227,228,162,196,161,162,196,196,196,196,196,196,196,196,196,161,228,229,7,0,7,7,0,0,6,6,6, -6,7,7,7,7,7,7,227,228,229,227,228,228,228,228,228,228,228,228,228,229,7,7,7,7,7,7,7,6,6,0,6, -6,7,7,7,7,6,7,7,6,6,6,7,6,6,6,6,0,7,7,7,7,0,7,7,7,7,7,7,6,6,7,6, -6,7,7,7,7,7,7,7,7,7,7,7,7,7,6,6,6,6,0,7,7,7,0,7,7,7,7,6,6,0,0,6, -7,7,7,7,7,7,7,0,7,6,6,0,7,7,7,0,7,7,7,7,7,7,0,0,0,0,7,6,7,0,0,6, -0,0,6,6,7,6,6,6,0,7,6,7,7,7,7,7,7,7,7,7,7,7,0,0,0,0,6,7,0,0,0,6, -7,7,0,7,7,8,8,6,7,6,6,7,7,7,7,7,7,7,7,7,7,7,0,7,7,7,6,7,7,7,0,6, -7,7,0,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,6,6,6,7,7,6, -7,8,8,8,7,7,7,8,8,7,7,7,7,0,7,7,7,7,7,7,7,7,7,7,7,7,7,7,6,6,7,6, +6,7,6,6,195,197,0,6,6,6,8,8,8,8,7,7,195,197,0,8,8,163,164,165,7,7,7,8,0,8,0,6, +6,6,0,0,195,197,8,7,7,8,8,8,8,7,0,7,195,197,8,8,8,195,196,193,164,165,7,7,8,8,0,6, +6,6,6,0,195,197,8,8,7,7,7,7,7,7,7,7,195,197,0,8,163,194,196,161,162,193,165,8,8,8,0,6, +6,6,6,7,195,193,165,0,8,8,7,7,7,7,7,0,195,197,7,163,194,161,162,197,227,162,197,7,8,0,7,6, +6,6,6,6,227,162,197,0,0,0,0,0,0,0,0,0,195,193,164,194,161,229,195,197,8,195,197,7,8,7,7,6, +6,6,7,0,0,195,193,164,164,164,164,164,164,164,164,164,194,196,196,196,193,165,227,229,165,195,197,7,7,7,7,6, +6,6,7,7,7,227,228,228,228,228,162,161,228,228,228,228,162,196,196,196,196,193,164,194,193,194,197,8,8,7,0,6, +6,6,7,7,7,7,7,7,7,7,195,197,8,6,6,8,195,196,196,196,196,196,196,196,196,196,197,7,7,7,7,6, +6,0,7,7,7,7,163,164,165,7,195,197,6,6,6,6,227,228,162,196,196,196,196,196,196,196,197,7,7,7,7,7, +6,0,7,7,6,163,194,196,197,6,195,197,6,6,6,163,164,164,194,196,196,161,228,228,162,196,197,7,7,7,7,7, +6,0,7,6,6,195,196,196,193,165,195,197,6,6,163,194,196,196,196,196,196,193,165,7,195,196,193,165,0,7,7,6, +6,7,7,6,6,227,162,196,196,193,194,193,164,164,194,196,196,196,196,196,196,196,193,164,194,196,196,197,0,0,6,6, +6,7,7,7,163,164,194,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,197,7,7,6,6, +6,7,7,7,195,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,161,228,228,228,229,0,0,6,6, +6,7,7,7,195,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,197,0,7,7,0,0,6,6,6, +6,7,7,7,195,196,196,196,196,196,161,228,228,162,196,161,228,228,228,162,196,196,196,197,7,7,7,7,6,6,0,6, +6,7,7,7,195,196,196,196,196,196,197,7,6,195,196,197,0,7,163,194,196,196,196,197,7,7,7,7,6,6,7,6, +6,7,7,7,195,196,196,196,196,196,193,164,164,194,196,193,164,164,194,196,161,162,161,229,7,7,7,6,6,0,0,6, +7,7,7,7,195,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,197,227,229,0,0,0,7,6,7,0,0,6, +0,0,6,6,195,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,197,7,0,0,0,0,6,7,0,0,0,6, +7,7,0,7,227,162,196,196,196,196,196,196,196,196,196,196,196,196,196,161,229,7,0,7,7,7,6,7,7,7,0,6, +7,7,0,7,7,227,228,228,228,228,228,162,196,161,228,228,228,228,228,229,7,7,7,7,7,7,6,6,6,7,7,6, +7,8,8,8,7,7,7,8,8,7,7,227,228,229,7,7,7,7,7,7,7,7,7,7,7,7,7,7,6,6,7,6, 6,7,7,7,7,7,7,7,6,6,6,6,6,6,6,7,7,7,0,7,7,7,7,7,7,7,7,7,6,6,0,6, 6,8,8,8,8,8,8,8,8,8,8,8,8,0,0,6,6,6,6,6,6,6,6,6,6,6,6,6,6,0,0,6, 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6 @@ -181,5 +223,22 @@ <object id="22" x="256" y="48" width="6.9375" height="16"/> <object id="23" x="280.969" y="48" width="6.9375" height="16"/> <object id="24" x="263.375" y="54.875" width="17.25" height="9.0625"/> + <object id="55" x="346.75" y="155" width="11" height="40.25"/> + <object id="56" x="330.75" y="170.75" width="14.25" height="8.5"/> + <object id="57" x="358.75" y="186.75" width="26.5" height="9"/> + <object id="58" x="379.25" y="140.5" width="8.25" height="36.75"/> + <object id="59" x="387.75" y="155" width="15" height="23"/> + <object id="60" x="395" y="178.5" width="8.5" height="16.5"/> + <object id="61" x="379.5" y="178" width="5" height="7.75"/> + <object id="62" x="188.909" y="203.818" width="36.1818" height="70.5455"/> + <object id="64" x="225.818" y="203.455" width="16.7273" height="55.0909"/> + <object id="65" x="242.909" y="203.636" width="16" height="39.6364"/> + <object id="66" x="260.182" y="234.727" width="30.9091" height="8.90909"/> + <object id="67" x="173" y="346.333" width="36" height="23"/> + <object id="68" x="253" y="347" width="36.3333" height="23.3333"/> + <object id="69" x="290.333" y="348" width="16.6667" height="7.33333"/> + <object id="70" x="347.636" y="250.727" width="40.7273" height="7.81818"/> + <object id="71" x="363.455" y="259.636" width="24.7273" height="15.0909"/> + <object id="72" x="182" y="356.364" width="14.3636" height="3.63636"/> </objectgroup> </map> diff --git a/raw/tileset.aseprite b/raw/tileset.aseprite Binary files differindex c5e0e49..d5f8f6b 100644 --- a/raw/tileset.aseprite +++ b/raw/tileset.aseprite diff --git a/scenes/level1_scene.lua b/scenes/level1_scene.lua index 58fb639..0519ca3 100644 --- a/scenes/level1_scene.lua +++ b/scenes/level1_scene.lua @@ -1,10 +1,12 @@ level1 = {} -- Level1 State require("core.screen_shaker") Map = require("core.map") +--require("scenes.menu_scene") +local Gamestate = require("libs.hump.gamestate") -- imports require("core.constants") require("core.ambience") - +local map function level1:init() constants.resetColors() screenShake = ScreenShaker() @@ -13,6 +15,7 @@ function level1:init() end function level1:enter(previous) + end function level1:update(dt) @@ -27,10 +30,13 @@ end function level1:keypressed(key, scancode) map:keypressed(key, scancode) + if scancode=="r" then + love.audio.stop( ) + Gamestate.switch(menu) + end end function level1:leave() - map = nil end -return level1
\ No newline at end of file +return level1 diff --git a/scenes/menu_scene.lua b/scenes/menu_scene.lua index e90b805..5c30674 100644 --- a/scenes/menu_scene.lua +++ b/scenes/menu_scene.lua @@ -4,8 +4,6 @@ local Timer = require "libs.hump.timer" local Gamestate = require("libs.hump.gamestate") Moonshine = require("libs.moonshine") require("core.constants") --- scenes -require("scenes.level1_scene"); local titleFontSize1 = 35 local titleFontSize2 = 40 @@ -18,7 +16,7 @@ function menu:init() titleFont1 = love.graphics.newFont('assets/fonts/C800.ttf', titleFontSize1) titleFont2 = love.graphics.newFont('assets/fonts/Lazer84.ttf', titleFontSize2) startMsgFont = love.graphics.newFont('assets/fonts/C800.ttf', msgFontSize) - music = love.audio.newSource("assets/music/Stevia Sphere - Drum machine dreams.ogg", "stream") + music = love.audio.newSource("assets/music/title.ogg", "stream") titleText1 = love.graphics.newText(titleFont1, "Your Enemy is in Another") titleText2 = love.graphics.newText(titleFont2, "Dungeon") msgText = love.graphics.newText(startMsgFont, "Press X to START") @@ -87,6 +85,10 @@ function menu:keyreleased(key, scancode) end end +function love.touchpressed( id, x, y, dx, dy, pressure ) + Gamestate.switch(level1) +end + function generateStarfield() image = love.graphics.newImage("assets/images/particle.png") psystem = love.graphics.newParticleSystem(image, 2500) @@ -104,4 +106,4 @@ function generateStarfield() return psystem end -return menu
\ No newline at end of file +return menu |