Skip to content

Commit

Permalink
lots of ecs bugfixes, adds Effect class
Browse files Browse the repository at this point in the history
  • Loading branch information
xharris committed Sep 27, 2020
1 parent 7c4cd3b commit b8f8ce5
Show file tree
Hide file tree
Showing 38 changed files with 3,585 additions and 8,603 deletions.
6 changes: 0 additions & 6 deletions blankejs.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@
"folders": [
{
"path": "."
},
{
"path": "/Users/xharris/Documents/blankejs-tutorials"
},
{
"path": "D:/Documents/PROJECTS/blankejs-tutorials"
}
],
"settings": {
Expand Down
10 changes: 4 additions & 6 deletions love2d/lua/blanke/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3679,7 +3679,7 @@ do
end
end;
-- ignore collisions
teleport = function(obj, x, y)
teleport = function(obj)
if obj and not obj.destroyed and obj.hasHitbox then
local hb, offx, offy = checkHitArea(obj)
world:update(obj,
Expand All @@ -3702,12 +3702,12 @@ do
local filter_result
local filter = function(_obj, other)
local ret = _obj.reaction or Hitbox.default_reaction
if _obj.reactions and _obj.reactions[other.tag] then ret = _obj.reactions[other.tag] else
if _obj.reaction then ret = _obj.reaction end
end
if other.reactions and other.reactions[_obj.tag] then ret = other.reactions[_obj.tag] else
if other.reaction then ret = other.reaction end
end
if _obj.reactions and _obj.reactions[other.tag] then ret = _obj.reactions[other.tag] else
if _obj.reaction then ret = _obj.reaction end
end
if _obj.filter then ret = _obj:filter(other) end

filter_result = ret
Expand Down Expand Up @@ -5143,8 +5143,6 @@ do
}
end

Signal.emit('__main')

love.load = function()
if do_profiling and do_profiling > 0 then
love.profiler = blanke_require('profile')
Expand Down
7 changes: 7 additions & 0 deletions love2d/lua/ecs/clasp.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
-- evolbug 2017, MIT License
-- clasp - class library

local class = { init = function()end; extend = function(self, proto) local meta = {}
local proto = setmetatable(proto or {},{__index=self, __call=function(_,...) local o=setmetatable({},meta) return o,o:init(...) end})
meta.__index = proto ; for k,v in pairs(proto.__ or {}) do meta['__'..k]=v end ; return proto end }
return setmetatable(class, { __call = class.extend })
Loading

0 comments on commit b8f8ce5

Please sign in to comment.