Explorar o código

app folder; more fixes;

bjorn %!s(int64=9) %!d(string=hai) anos
pai
achega
6a9a01ab48

+ 0 - 0
lib/core/buffs.lua → app/core/buffs.lua


+ 8 - 8
lib/core/collision.lua → app/core/collision.lua

@@ -7,7 +7,7 @@ Collision.onCollide = function(_, a, b, dx, dy)
 end
 
 function Collision:init()
-  self.hc = require 'lib/deps/hc'
+  self.hc = require 'lib/hc'
   ctx.event:on('collision.attach', f.cur(self.attach, self))
   ctx.event:on('collision.detach', f.cur(self.detach, self))
   ctx.event:on('collision.move', f.cur(self.move, self))
@@ -30,7 +30,7 @@ function Collision:attach(data)
 end
 
 function Collision:detach(data)
-  self.hc:remove(data.object.shape)
+  self.hc.remove(data.object.shape)
   data.object.shape = nil
 end
 
@@ -47,7 +47,7 @@ function Collision:move(data)
 end
 
 function Collision:update()
-  for shape in self.hc:activeShapes() do
+  --[[for shape in self.hc:activeShapes() do
     if shape.owner then
       self:move({object = shape.owner})
     end
@@ -59,7 +59,7 @@ function Collision:update()
     if shape.owner then
       self:move({object = shape.owner})
     end
-  end
+  end]]
 end
 
 function Collision:pointTest(x, y, options)
@@ -109,18 +109,18 @@ function Collision:lineTest(x1, y1, x2, y2, options)
 end
 
 function Collision:circleTest(x, y, r, options)
-  local circle = self.hc:addCircle(x, y, r)
+  local circle = self.hc.circle(x, y, r)
   local tag, fn, all = options.tag, options.fn, options.all
   local res = all and {} or nil
 
-  for shape in pairs(circle:neighbors()) do
+  for shape in pairs(self.hc.neighbors(circle)) do
     if circle:collidesWith(shape) then
       if (not tag) or shape.owner.collision.tag == tag then
         if (not fn) or fn(shape.owner) then
           if all then
             table.insert(res, shape.owner)
           else
-            self.hc:remove(circle)
+            self.hc.remove(circle)
             return shape.owner
           end
         end
@@ -128,6 +128,6 @@ function Collision:circleTest(x, y, r, options)
     end
   end
 
-  self.hc:remove(circle)
+  self.hc.remove(circle)
   return res
 end

+ 0 - 0
lib/core/context.lua → app/core/context.lua


+ 0 - 0
lib/core/effects.lua → app/core/effects.lua


+ 0 - 0
lib/core/event.lua → app/core/event.lua


+ 0 - 0
lib/core/game.lua → app/core/game.lua


+ 0 - 0
lib/core/input.lua → app/core/input.lua


+ 0 - 0
lib/core/net.lua → app/core/net.lua


+ 0 - 0
lib/core/particles.lua → app/core/particles.lua


+ 0 - 0
lib/core/server.lua → app/core/server.lua


+ 0 - 0
lib/core/sound.lua → app/core/sound.lua


+ 0 - 0
lib/core/spell.lua → app/core/spell.lua


+ 0 - 0
lib/core/spells.lua → app/core/spells.lua


+ 0 - 0
lib/core/stream.lua → app/core/stream.lua


+ 0 - 0
lib/core/typo.lua → app/core/typo.lua


+ 0 - 0
lib/core/view.lua → app/core/view.lua


+ 0 - 0
lib/core/weapon.lua → app/core/weapon.lua


+ 0 - 0
lib/editor/editor.lua → app/editor/editor.lua


+ 0 - 0
lib/editor/editordebug.lua → app/editor/editordebug.lua


+ 0 - 0
lib/editor/editordeletor.lua → app/editor/editordeletor.lua


+ 0 - 0
lib/editor/editordragger.lua → app/editor/editordragger.lua


+ 0 - 0
lib/editor/editorgrid.lua → app/editor/editorgrid.lua


+ 0 - 0
lib/editor/editorsaver.lua → app/editor/editorsaver.lua


+ 0 - 0
lib/editor/editorscaler.lua → app/editor/editorscaler.lua


+ 0 - 0
lib/editor/editorselector.lua → app/editor/editorselector.lua


+ 1 - 1
lib/editor/editorview.lua → app/editor/editorview.lua

@@ -1,4 +1,4 @@
-require('lib/core/view')
+require 'app/core/view'
 
 EditorView = extend(View)
 

+ 0 - 0
lib/goregous/goregous.lua → app/goregous/goregous.lua


+ 0 - 0
lib/loader.lua → app/loader.lua


+ 0 - 0
lib/love.lua → app/love.lua


+ 0 - 0
lib/map.lua → app/map.lua


+ 0 - 0
lib/netclient.lua → app/netclient.lua


+ 0 - 0
lib/netserver.lua → app/netserver.lua


+ 0 - 0
lib/patcher.lua → app/patcher.lua


+ 0 - 0
lib/player.lua → app/player.lua


+ 0 - 0
lib/playerdummy.lua → app/playerdummy.lua


+ 0 - 0
lib/playermain.lua → app/playermain.lua


+ 1 - 1
lib/playerrobot.lua → app/playerrobot.lua

@@ -1,4 +1,4 @@
-require 'lib/playerserver'
+require 'app/playerserver'
 
 PlayerRobot = extend(PlayerServer)
 

+ 0 - 0
lib/players.lua → app/players.lua


+ 0 - 0
lib/playerserver.lua → app/playerserver.lua


+ 2 - 2
data/hud/hudchat.lua

@@ -1,4 +1,4 @@
-local rich = require 'lib/deps/richtext/richtext'
+local rich = require 'lib/richtext'
 
 HudChat = class()
 
@@ -106,5 +106,5 @@ end
 function HudChat:refresh(width)
   local u, v = ctx.hud.u, ctx.hud.v
   local width = u * .35
-  self.richText = rich.new({self.log, width, white = {255, 255, 255}, purple = {190, 160, 220}, orange = {240, 160, 140}, red = {255, 0, 0}, green = {0, 255, 0}})
+  self.richText = rich:new({self.log, width, white = {255, 255, 255}, purple = {190, 160, 220}, orange = {240, 160, 140}, red = {255, 0, 0}, green = {0, 255, 0}})
 end

+ 0 - 0
lib/deps/hc/class.lua → lib/hc/class.lua


+ 0 - 0
lib/deps/hc/gjk.lua → lib/hc/gjk.lua


+ 0 - 0
lib/deps/hc/init.lua → lib/hc/init.lua


+ 0 - 0
lib/deps/hc/polygon.lua → lib/hc/polygon.lua


+ 0 - 0
lib/deps/hc/shapes.lua → lib/hc/shapes.lua


+ 0 - 0
lib/deps/hc/spatialhash.lua → lib/hc/spatialhash.lua


+ 0 - 0
lib/deps/hc/vector-light.lua → lib/hc/vector-light.lua


+ 0 - 0
lib/deps/richtext/richtext.lua → lib/richtext.lua


+ 0 - 0
lib/deps/slam/slam.lua → lib/slam.lua


+ 0 - 0
lib/deps/lutil/util.lua → lib/util.lua


+ 4 - 6
require.lua

@@ -10,10 +10,8 @@ local function load(dir)
 end
 
 require 'enet'
-load 'lib/deps/slam'
-load 'lib/deps/lutil'
-load 'lib/deps'
-load 'lib/core'
 load 'lib'
-load 'lib/editor'
-load 'lib/goregous'
+load 'app/core'
+load 'app'
+load 'app/editor'
+load 'app/goregous'