diff options
author | Indrajith K L | 2022-02-27 01:15:31 +0530 |
---|---|---|
committer | Indrajith K L | 2022-02-27 01:15:31 +0530 |
commit | 62ff5245c26c305e35a2903cc64a60cb20718e96 (patch) | |
tree | 9042f9917e77b584b0ceb421166221ef7777a5d1 /utils | |
download | YEAD-62ff5245c26c305e35a2903cc64a60cb20718e96.tar.gz YEAD-62ff5245c26c305e35a2903cc64a60cb20718e96.tar.bz2 YEAD-62ff5245c26c305e35a2903cc64a60cb20718e96.zip |
Initial Commit
* ECS - In-Progress
* GameStates - Skeleton Implemented
* Library Integrations - Completed
* Levels - In-Progress
Diffstat (limited to 'utils')
-rw-r--r-- | utils/constants.lua | 11 | ||||
-rw-r--r-- | utils/enitity.lua | 0 | ||||
-rw-r--r-- | utils/map.lua | 51 |
3 files changed, 62 insertions, 0 deletions
diff --git a/utils/constants.lua b/utils/constants.lua new file mode 100644 index 0000000..2210d65 --- /dev/null +++ b/utils/constants.lua @@ -0,0 +1,11 @@ +constants = {} + +constants.resetBgColor = {0, 0, 0} +constants.resetFgColor = {1, 1, 1} + +function constants:resetColors() + love.graphics.setColor(constants.resetFgColor) + love.graphics.setBackgroundColor(constants.resetBgColor) +end + +return constants
\ No newline at end of file diff --git a/utils/enitity.lua b/utils/enitity.lua new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/utils/enitity.lua diff --git a/utils/map.lua b/utils/map.lua new file mode 100644 index 0000000..f8f4043 --- /dev/null +++ b/utils/map.lua @@ -0,0 +1,51 @@ +Class = require("libs.hump.class") +Gamestate = require("libs.hump.gamestate") +STI = require("libs.sti") +Moonshine = require("libs.moonshine") +Camera = require("libs.hump.camera") + +Map = Class { + init = function(self, mapName) -- TODO pass map instance parameter + width, height = love.graphics.getDimensions( ) + effect = Moonshine(width, height, Moonshine.effects.crt) + .chain(Moonshine.effects.vignette) + .chain(Moonshine.effects.scanlines) + .chain(Moonshine.effects.chromasep) + effect.scanlines.thickness = .2 + effect.scanlines.opacity = .5 + effect.chromasep.angle = 1 + effect.chromasep.radius = 5 + camera = Camera() + camera:zoom(1) + print("Map Manager") + currentMap = STI("assets/maps/"..mapName..".lua") + if currentMap.layers["entities"] then + for i,obj in pairs(currentMap.layers["entities"].objects) do + print(obj.name) + end + end + end, + entities={} +} + +function Map:update(dt) + print("Map Update") + currentMap:update(dt) +end + +function Map:draw() + print("Map Draw") + camera:attach() + effect(function() + + currentMap:drawLayer(currentMap.layers["ground"]) + + end) + camera:detach() +end + +function Map:keypressed(key, scancode) + +end + +return Map
\ No newline at end of file |