aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIndrajith K L2022-03-01 02:48:49 +0530
committerIndrajith K L2022-03-01 02:48:49 +0530
commitf5eaa22a1c9598c9f7a55a41614d1ce4769dee4a (patch)
treeafbb7585324e9efbfd5820f07d9a0239193d3e99
parent05add67d6f95c51a3501bc15a742cf9fccc4b67e (diff)
downloadYEAD-f5eaa22a1c9598c9f7a55a41614d1ce4769dee4a.tar.gz
YEAD-f5eaa22a1c9598c9f7a55a41614d1ce4769dee4a.tar.bz2
YEAD-f5eaa22a1c9598c9f7a55a41614d1ce4769dee4a.zip
* Adds Ambience SFX & Management
* Notification - In-Progress * Collision Callbacks * Interactive & Pickable entities - In-Progress
-rw-r--r--assets/images/icon.pngbin0 -> 513 bytes
-rw-r--r--assets/images/tileset.pngbin3238 -> 3048 bytes
-rw-r--r--assets/maps/level1.lua271
-rw-r--r--assets/sfx/heartbeat_fast_0.wavbin0 -> 397080 bytes
-rw-r--r--assets/sfx/hits/README.txt4
-rw-r--r--assets/sfx/monster_growl.wavbin0 -> 448152 bytes
-rw-r--r--assets/sfx/sfx_deathscream_alien1.wavbin133922 -> 0 bytes
-rw-r--r--conf.lua2
-rw-r--r--core/ambience.lua15
-rw-r--r--core/constants.lua (renamed from utils/constants.lua)0
-rw-r--r--core/enitity.lua (renamed from utils/enitity.lua)0
-rw-r--r--core/map.lua (renamed from utils/map.lua)58
-rw-r--r--core/notifications.lua31
-rw-r--r--core/screen_shaker.lua (renamed from utils/screen_shaker.lua)4
-rw-r--r--game_icon.icobin0 -> 16791 bytes
-rw-r--r--libs/tserial.lua46
-rw-r--r--scenes/level1_scene.lua8
-rw-r--r--scenes/menu_scene.lua2
18 files changed, 356 insertions, 85 deletions
diff --git a/assets/images/icon.png b/assets/images/icon.png
new file mode 100644
index 0000000..221a69c
--- /dev/null
+++ b/assets/images/icon.png
Binary files differ
diff --git a/assets/images/tileset.png b/assets/images/tileset.png
index 40ffa80..ed35eff 100644
--- a/assets/images/tileset.png
+++ b/assets/images/tileset.png
Binary files differ
diff --git a/assets/maps/level1.lua b/assets/maps/level1.lua
index 41084c5..1e32139 100644
--- a/assets/maps/level1.lua
+++ b/assets/maps/level1.lua
@@ -8,8 +8,8 @@ return {
height = 32,
tilewidth = 16,
tileheight = 16,
- nextlayerid = 6,
- nextobjectid = 25,
+ nextlayerid = 7,
+ nextobjectid = 30,
properties = {},
tilesets = {
{
@@ -34,7 +34,76 @@ return {
height = 16
},
properties = {},
- wangsets = {},
+ wangsets = {
+ {
+ name = "white_path",
+ tile = -1,
+ properties = {},
+ colors = {
+ {
+ color = { 255, 0, 0 },
+ name = "whitePath_terrain",
+ probability = 1,
+ tile = -1,
+ properties = {}
+ }
+ },
+ wangtiles = {
+ {
+ wangid = { 1, 1, 1, 0, 1, 1, 1, 1 },
+ tileid = 160
+ },
+ {
+ wangid = { 1, 1, 1, 1, 1, 0, 1, 1 },
+ tileid = 161
+ },
+ {
+ wangid = { 0, 0, 1, 1, 1, 0, 0, 0 },
+ tileid = 162
+ },
+ {
+ wangid = { 0, 0, 1, 1, 1, 1, 1, 0 },
+ tileid = 163
+ },
+ {
+ wangid = { 0, 0, 0, 0, 1, 1, 1, 0 },
+ tileid = 164
+ },
+ {
+ wangid = { 1, 0, 1, 1, 1, 1, 1, 1 },
+ tileid = 192
+ },
+ {
+ wangid = { 1, 1, 1, 1, 1, 1, 1, 0 },
+ tileid = 193
+ },
+ {
+ wangid = { 1, 1, 1, 1, 1, 0, 0, 0 },
+ tileid = 194
+ },
+ {
+ wangid = { 1, 1, 1, 1, 1, 1, 1, 1 },
+ tileid = 195
+ },
+ {
+ wangid = { 1, 0, 0, 0, 1, 1, 1, 1 },
+ tileid = 196
+ },
+ {
+ wangid = { 1, 1, 1, 0, 0, 0, 0, 0 },
+ tileid = 226
+ },
+ {
+ wangid = { 1, 1, 1, 0, 0, 0, 1, 1 },
+ tileid = 227
+ },
+ {
+ wangid = { 1, 0, 0, 0, 0, 0, 1, 1 },
+ t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8, 0, 6,
+ 6, 6, 6, 6, 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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 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
}
},
{
@@ -157,8 +226,8 @@ return {
objects = {
{
id = 2,
- name = "",
- type = "",
+ name = "player",
+ type = "player",
shape = "rectangle",
x = 128,
y = 112,
@@ -167,6 +236,70 @@ return {
rotation = 0,
visible = true,
properties = {}
+ },
+ {
+ id = 25,
+ name = "sign",
+ type = "interactive",
+ shape = "rectangle",
+ x = 240,
+ y = 47.25,
+ width = 15.5,
+ height = 17,
+ rotation = 0,
+ visible = true,
+ properties = {
+ ["data"] = "Beware of the Alien Monster",
+ ["interactive_type"] = "message_notification"
+ }
+ },
+ {
+ id = 26,
+ name = "potion",
+ type = "interactive",
+ shape = "rectangle",
+ x = 208.5,
+ y = 80.75,
+ width = 15,
+ height = 15.25,
+ rotation = 0,
+ visible = true,
+ properties = {
+ ["data"] = "Acquired Potion",
+ ["interactive_type"] = "pickable"
+ }
+ },
+ {
+ id = 27,
+ name = "potion",
+ type = "interactive",
+ shape = "rectangle",
+ x = 176.5,
+ y = 112.25,
+ width = 15,
+ height = 16,
+ rotation = 0,
+ visible = true,
+ properties = {
+ ["data"] = "Acquired Potion",
+ ["interactive_type"] = "pickable"
+ }
+ },
+ {
+ id = 28,
+ name = "potion",
+ type = "interactive",
+ shape = "rectangle",
+ x = 224,
+ y = 112.25,
+ width = 15.75,
+ height = 15.25,
+ rotation = 0,
+ visible = true,
+ properties = {
+ ["data"] = "Acquired Potion",
+ ["interactive_type"] = "pickable"
+ }
}
}
},
@@ -332,38 +465,38 @@ return {
properties = {},
encoding = "lua",
data = {
- 1, 1, 1, 1, 1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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
}
}
}
diff --git a/assets/sfx/heartbeat_fast_0.wav b/assets/sfx/heartbeat_fast_0.wav
new file mode 100644
index 0000000..7fd7b2a
--- /dev/null
+++ b/assets/sfx/heartbeat_fast_0.wav
Binary files differ
diff --git a/assets/sfx/hits/README.txt b/assets/sfx/hits/README.txt
new file mode 100644
index 0000000..537ebef
--- /dev/null
+++ b/assets/sfx/hits/README.txt
@@ -0,0 +1,4 @@
+Adapted from Punch, slap, n' kick.wav
+by CGEffex
+http://freesound.org/people/CGEffex/sounds/98341/
+http://creativecommons.org/licenses/by/3.0/ \ No newline at end of file
diff --git a/assets/sfx/monster_growl.wav b/assets/sfx/monster_growl.wav
new file mode 100644
index 0000000..9fc1c91
--- /dev/null
+++ b/assets/sfx/monster_growl.wav
Binary files differ
diff --git a/assets/sfx/sfx_deathscream_alien1.wav b/assets/sfx/sfx_deathscream_alien1.wav
deleted file mode 100644
index 7786710..0000000
--- a/assets/sfx/sfx_deathscream_alien1.wav
+++ /dev/null
Binary files differ
diff --git a/conf.lua b/conf.lua
index 1ae0863..8fbb0e5 100644
--- a/conf.lua
+++ b/conf.lua
@@ -4,4 +4,6 @@ function love.conf(t)
t.window.fullscreen = false
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
diff --git a/core/ambience.lua b/core/ambience.lua
new file mode 100644
index 0000000..13919d9
--- /dev/null
+++ b/core/ambience.lua
@@ -0,0 +1,15 @@
+Class = require("libs.hump.class")
+
+Ambience = Class {
+ init = function(self, ambienceTypes)
+ if ambienceTypes then
+ for i,ambience in pairs(ambienceTypes) do
+ local ambientSound = love.audio.newSource("assets/sfx/"..ambience..".ogg", "static")
+ ambientSound:setLooping(true)
+ ambientSound:play()
+ end
+ end
+ end
+}
+
+return Ambience \ No newline at end of file
diff --git a/utils/constants.lua b/core/constants.lua
index 5284e6d..5284e6d 100644
--- a/utils/constants.lua
+++ b/core/constants.lua
diff --git a/utils/enitity.lua b/core/enitity.lua
index e69de29..e69de29 100644
--- a/utils/enitity.lua
+++ b/core/enitity.lua
diff --git a/utils/map.lua b/core/map.lua
index 1f06487..acbdc4a 100644
--- a/utils/map.lua
+++ b/core/map.lua
@@ -4,23 +4,28 @@ STI = require("libs.sti")
Moonshine = require("libs.moonshine")
Camera = require("libs.hump.camera")
Windfield = require("libs.windfield")
+require("libs.tserial")
+print(TSerial)
+require("core.notifications")
-zoomFactor = 2
-player = {
+local zoomFactor = 2
+local player = {
x=0,
y=0,
sprite=love.graphics.newImage("assets/images/player_demo.png"),
speed=100
}
-windowWidth, windowHeight = love.graphics.getDimensions()
-_w = windowWidth/zoomFactor
-_h = windowHeight/zoomFactor
+local windowWidth, windowHeight = love.graphics.getDimensions()
+local _w = windowWidth/zoomFactor
+local _h = windowHeight/zoomFactor
Map = Class {
__include=Gamestate,
init = function(self, mapName)
_gameWorld = Windfield.newWorld(0,0)
+ _gameWorld:addCollisionClass('player')
+ _gameWorld:addCollisionClass('interactive')
effect = Moonshine(windowWidth, windowHeight, Moonshine.effects.crt)
.chain(Moonshine.effects.vignette)
.chain(Moonshine.effects.scanlines)
@@ -30,15 +35,32 @@ Map = Class {
effect.chromasep.angle = 1
effect.chromasep.radius = 2
+ notifications = Notifications(zoomFactor)
camera = Camera()
camera:zoom(zoomFactor)
currentMap = STI("assets/maps/"..mapName..".lua")
if currentMap.layers["entities"] then
for i,obj in pairs(currentMap.layers["entities"].objects) do
- player.x = obj.x
- player.y = obj.y
- player.collider = _gameWorld:newBSGRectangleCollider(player.x, player.y, 8, 8, 0)
- player.collider:setFixedRotation(true)
+ 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:setFixedRotation(true)
+ player.collider:setCollisionClass('player')
+ end
+
+ if obj.type=="interactive" then
+ local collider = _gameWorld:newRectangleCollider(obj.x, obj.y, obj.width, obj.height)
+ local interactiveData = {
+ type = obj.type,
+ interactive_type = obj.properties.interactive_type,
+ data = obj.properties.data
+ }
+ collider:setObject(interactiveData)
+ collider:setCollisionClass('interactive')
+ collider:setType("static")
+ end
end
end
@@ -100,6 +122,21 @@ function Map:update(dt)
if camera.y > (mapHeight - _h/2) then
camera.y = (mapHeight - _h/2)
end
+
+ if player.collider:enter('interactive') then
+ local _interColliderData = player.collider:getEnterCollisionData('interactive')
+ local interactiveCollider = _interColliderData.collider
+ local interactiveData = interactiveCollider:getObject()
+
+ if interactiveData.interactive_type=="pickable" then
+ notifications:send(interactiveData.data)
+ end
+
+ if interactiveData.interactive_type=="message_notification" then
+ notifications:send(interactiveData.data)
+ end
+ end
+ notifications:update(dt)
end
function Map:draw()
@@ -109,8 +146,9 @@ function Map:draw()
drawMapLayer("decorations")
love.graphics.draw(player.sprite, player.x, player.y)
drawMapLayer("foreground")
- -- _gameWorld:draw()
+ _gameWorld:draw()
camera:detach()
+ notifications:draw()
end)
end
diff --git a/core/notifications.lua b/core/notifications.lua
new file mode 100644
index 0000000..05950f2
--- /dev/null
+++ b/core/notifications.lua
@@ -0,0 +1,31 @@
+Class = require("libs.hump.class")
+Timer = require("libs.hump.timer")
+Notifications = Class {
+ init = function(self, zoomFactor)
+ color = {1, 0, 0, 1}
+ local windowWidth, windowHeight = love.graphics.getDimensions()
+ end,
+ _message={}
+}
+
+function Notifications:update(dt)
+ Timer.update(dt)
+end
+
+function Notifications:draw()
+ if self._message then
+ love.graphics.setColor(color)
+ love.graphics.print(self._message, 10, wind)
+ end
+end
+
+function Notifications:send(message)
+ self._message = message
+ color = {1, 0, 0, 1}
+ if Timer then
+ Timer.clear()
+ end
+ Timer.tween(5, color, {0, 0, 0, 0}, 'linear')
+end
+
+return Notifications \ No newline at end of file
diff --git a/utils/screen_shaker.lua b/core/screen_shaker.lua
index aef89e4..0316559 100644
--- a/utils/screen_shaker.lua
+++ b/core/screen_shaker.lua
@@ -1,10 +1,10 @@
Class = require("libs.hump.class")
Shack = require("libs.shack")
-local Timer = require("libs.hump.Timer")
+local Timer = require("libs.hump.timer")
ScreenShaker = Class {
init = function(self)
- monsterGrowl = love.audio.newSource("assets/sfx/sfx_deathscream_alien1.wav", "static")
+ monsterGrowl = love.audio.newSource("assets/sfx/monster_growl.wav", "static")
local width, height = love.graphics.getDimensions()
Shack:setDimensions(width, height)
Timer.every(10, shakeScreen)
diff --git a/game_icon.ico b/game_icon.ico
new file mode 100644
index 0000000..2f02cfb
--- /dev/null
+++ b/game_icon.ico
Binary files differ
diff --git a/libs/tserial.lua b/libs/tserial.lua
new file mode 100644
index 0000000..c082e14
--- /dev/null
+++ b/libs/tserial.lua
@@ -0,0 +1,46 @@
+--- TSerial v1.3, a simple table serializer which turns tables into Lua script
+-- @author Taehl (SelfMadeSpirit@gmail.com)
+TSerial = {}
+
+--- Serializes a table into a string, in form of Lua script.
+-- @param t table to be serialized (may not contain any circular reference)
+-- @param drop if true, unserializable types will be silently dropped instead of raising errors
+-- if drop is a function, it will be called to serialize unsupported types
+-- @param indent if true, output "human readable" mode with newlines and indentation (for debug)
+-- @return string recreating given table
+function TSerial.pack(t, drop, indent)
+ assert(type(t) == "table", "Can only TSerial.pack tables.")
+ local s, indent = "{"..(indent and "\n" or ""), indent and math.max(type(indent)=="number" and indent or 0,0)
+ for k, v in pairs(t) do
+ local tk, tv, skip = type(k), type(v)
+ if tk == "boolean" then k = k and "[true]" or "[false]"
+ elseif tk == "string" then if string.format("%q",k) ~= '"'..k..'"' then k = '['..string.format("%q",k)..']' end
+ elseif tk == "number" then k = "["..k.."]"
+ elseif tk == "table" then k = "["..TSerial.pack(k, drop, indent and indent+1).."]"
+ elseif type(drop) == "function" then k = "["..string.format("%q",drop(k)).."]"
+ elseif drop then skip = true
+ else error("Attempted to TSerial.pack a table with an invalid key: "..tostring(k))
+ end
+ if tv == "boolean" then v = v and "true" or "false"
+ elseif tv == "string" then v = string.format("%q", v)
+ elseif tv == "number" then -- no change needed
+ elseif tv == "table" then v = TSerial.pack(v, drop, indent and indent+1)
+ elseif type(drop) == "function" then v = "["..string.format("%q",drop(v)).."]"
+ elseif drop then skip = true
+ else error("Attempted to TSerial.pack a table with an invalid value: "..tostring(v))
+ end
+ if not skip then s = s..string.rep("\t",indent or 0)..k.."="..v..","..(indent and "\n" or "") end
+ end
+ return s..string.rep("\t",(indent or 1)-1).."}"
+end
+
+--- Loads a table into memory from a string (like those output by Tserial.pack)
+-- @param s a string of Lua defining a table, such as "{2,4,8,ex="ample"}"
+-- @return a table recreated from the given string
+function TSerial.unpack(s)
+ assert(type(s) == "string", "Can only TSerial.unpack strings.")
+ assert(loadstring("TSerial.table="..s))()
+ local t = TSerial.table
+ TSerial.table = nil
+ return t
+end \ No newline at end of file
diff --git a/scenes/level1_scene.lua b/scenes/level1_scene.lua
index f532703..e5f4ec0 100644
--- a/scenes/level1_scene.lua
+++ b/scenes/level1_scene.lua
@@ -1,12 +1,14 @@
level1 = {} -- Level1 State
-require("utils.screen_shaker")
-Map = require("utils.map")
+require("core.screen_shaker")
+Map = require("core.map")
-- imports
-require("utils.constants")
+require("core.constants")
+require("core.ambience")
function level1:init()
constants.resetColors()
screenShake = ScreenShaker()
+ ambience = Ambience({"atmosphere1","thunder"})
map = Map("level1")
end
diff --git a/scenes/menu_scene.lua b/scenes/menu_scene.lua
index a930dcc..13bf8fd 100644
--- a/scenes/menu_scene.lua
+++ b/scenes/menu_scene.lua
@@ -3,7 +3,7 @@ menu = {} -- Menu Game State
local Timer = require "libs.hump.timer"
local Gamestate = require("libs.hump.gamestate")
Moonshine = require("libs.moonshine")
-require("utils.constants")
+require("core.constants")
-- scenes
require("scenes.level1_scene");