Skip to content

Commit

Permalink
Merge branch 'rotLua-boundcb'
Browse files Browse the repository at this point in the history
  • Loading branch information
paulofmandown committed Jul 5, 2017
2 parents 06a65aa + 54d1197 commit 84a0a7d
Show file tree
Hide file tree
Showing 79 changed files with 298 additions and 7,710 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ See [this page](http://paulofmandown.github.io/rotLove/) for a quick and dirty r

Included:

* Display - via [rlLove](https://github.com/paulofmandown/rlLove), only supports cp437 emulation
* Display - via [rlLove](https://github.com/paulofmandown/rlLove), only supports cp437 emulation
rather than full font support.
* TextDisplay - Text based display, accepts supplied fonts
* RNG - via [RandmLua](http://love2d.org/forums/viewtopic.php?f=5&t=3424).
Multiply With Carry, Linear congruential generator, and Mersenne Twister.
* RNG - via [RandomLua](http://love2d.org/forums/viewtopic.php?f=5&t=3424).
Multiply With Carry, Linear congruential generator, and Mersenne Twister.
Extended with set/getState methods.
* StringGenerator - Direct Port from [rot.js](http://ondras.github.io/rot.js/hp/)
* Map - Arena, Divided/Icey/Eller Maze, Digger/Uniform/Rogue* Dungeons.
* Map - Arena, Divided/Icey/Eller Maze, Digger/Uniform/Rogue* Dungeons.
Ported from [rot.js](http://ondras.github.io/rot.js/hp/).
* Noise Generator - Simplex Noise
* FOV - Bresenham Line based Ray Casting, Precise Shadow Casting
* Color - 147 Predefined colors; generate valid colors from string; add, multiply, or interpolate colors;
generate a random color from a reference and set of standard deviations.
* Color - 147 Predefined colors; generate valid colors from string; add, multiply, or interpolate colors;
generate a random color from a reference and set of standard deviations.
(straight port from [rot.js](http://ondras.github.io/rot.js/hp/))
* Path Finding - Dijkstra and AStar pathfinding ported from [rot.js](http://ondras.github.io/rot.js/hp/).
* Lighting - compute light emission and blending, ported from [rot.js](http://ondras.github.io/rot.js/hp/).
Expand All @@ -28,9 +28,9 @@ Getting started
==========
`git clone git://github.com/paulofmandown/rotLove.git`

Add the rotLove folder/directory to your project and require the rotLove file.
Add the contents of the src directory to lib/rotLove in your project and require the rot file.
```lua
ROT=require 'rotLove/rotLove'
ROT=require 'lib/rotLove/rot'
function love.load()
f=ROT.Display()
f:writeCenter('You did it!', math.floor(f:getHeight()/2))
Expand Down
2 changes: 1 addition & 1 deletion examples/action.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--[[ ActionScheduler ]]--
ROT= require 'rotLove/rotLove'
ROT=require 'src.rot'

function love.load()
s =ROT.Scheduler.Action:new()
Expand Down
2 changes: 1 addition & 1 deletion examples/arena.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--[[ Arena ]]--
ROT=require 'rotLove/rotLove'
ROT=require 'src.rot'
function love.load()
f=ROT.Display:new(80,24)
m=ROT.Map.Arena:new(f:getWidth(), f:getHeight())
Expand Down
6 changes: 1 addition & 5 deletions examples/astar.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ROT=require 'rotLove/rotLove'
ROT=require 'src.rot'

data={}

Expand Down Expand Up @@ -29,19 +29,15 @@ function love.keypressed() update=true end
function doTheThing()
local start=os.clock()
map:create(mapCallback)
write('Map Create in '..os.clock()-start)
p1=getRandomFloor(data)
p2=getRandomFloor(data)
p3=getRandomFloor(data)
start=os.clock()
astar=ROT.Path.AStar(p1[1], p1[2], passableCallback)
write('AStar init in '..os.clock()-start)
start=os.clock()
astar:compute(p2[1], p2[2], astarCallback)
write('AStar Compute in '..os.clock()-start)
start=os.clock()
astar:compute(p3[1], p3[2], astarCallback)
write('AStar Compute in '..os.clock()-start)

f:write('S', tonumber(p1[1]), tonumber(p1[2]), nil, {r=0, g=0, b=255, a=255})
f:write('E', tonumber(p2[1]), tonumber(p2[2]), nil, {r=0, g=0, b=255, a=255})
Expand Down
2 changes: 1 addition & 1 deletion examples/bresenham.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--[[ Bresenham Line of Sight ]]--
ROT=require 'rotLove/rotLove'
ROT=require 'src.rot'

function calbak(x, y, val)
map[x..','..y]=val
Expand Down
2 changes: 1 addition & 1 deletion examples/brogue.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--[[ Brogue ]]
ROT=require 'rotLove/rotLove'
ROT=require 'src.rot'

function love.load()
f =ROT.Display(80, 30)
Expand Down
4 changes: 1 addition & 3 deletions examples/brogueCaveGeneration.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ROT=require 'rotLove/rotLove'
ROT=require 'src.rot'
function love.load()
f =ROT.Display(79,29)
cl=ROT.Map.Cellular:new(f:getWidth(), f:getHeight())
Expand All @@ -17,7 +17,6 @@ function love.update()
if wait then return end
local cellStart=os.clock()
for i=1,5 do cl:create(calbak) end
write('cellGen in ' .. os.clock()-cellStart)
for x=1,f:getWidth() do
for y=1,f:getHeight() do
if cl._map[x][y]==1 then
Expand All @@ -30,7 +29,6 @@ function love.update()
end
end
end
write('built in '..os.clock()-start)
writeMap()
largest=2
id=2
Expand Down
2 changes: 1 addition & 1 deletion examples/cellular.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--[[ Cellular ]]--
ROT=require 'rotLove/rotLove'
ROT=require 'src.rot'
function love.load()
f =ROT.Display(80,24)
cl=ROT.Map.Cellular:new(f:getWidth(), f:getHeight())
Expand Down
2 changes: 1 addition & 1 deletion examples/characters.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ROT=require 'rotLove/rotLove'
ROT=require 'src.rot'
DSP=ROT.Display:new()
function love.load()
local y=1
Expand Down
3 changes: 1 addition & 2 deletions examples/color.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
ROT=require 'rotLove/rotLove'

ROT=require 'src.rot'
function love.load()
colorHandler=ROT.Color:new()
f=ROT.Display()
Expand Down
2 changes: 1 addition & 1 deletion examples/dice.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ROT=require 'rotLove/rotLove'
ROT=require 'src.rot'
local f, d_with_rng, lcg
function love.load()
f=ROT.Display:new(80,24)
Expand Down
2 changes: 1 addition & 1 deletion examples/digger.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--[[ Digger ]]
ROT=require 'rotLove/rotLove'
ROT=require 'src.rot'

local update=false
function love.load()
Expand Down
7 changes: 1 addition & 6 deletions examples/dijkstra.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ROT=require 'rotLove/rotLove'
ROT=require 'src.rot'

data={}

Expand Down Expand Up @@ -29,21 +29,16 @@ function love.keypressed() update=true end
function doTheThing()
local start=os.clock()
map:create(mapCallback)
write('Map Create in '..os.clock()-start)

p1=getRandomFloor(data)
p2=getRandomFloor(data)
p3=getRandomFloor(data)

start=os.clock()
dijkstra=ROT.Path.Dijkstra(p1[1], p1[2], passableCallback)
write('Dijkstra init in '..os.clock()-start)
start=os.clock()
dijkstra:compute(p2[1], p2[2], dijkstraCallback)
write('Dijkstra Compute in '..os.clock()-start)
start=os.clock()
dijkstra:compute(p3[1], p3[2], dijkstraCallback)
write('Dijkstra Compute in '..os.clock()-start)

f:write('S', tonumber(p1[1]), tonumber(p1[2]), nil, {r=0, g=0, b=255, a=255})
f:write('E', tonumber(p2[1]), tonumber(p2[2]), nil, {r=0, g=0, b=255, a=255})
Expand Down
2 changes: 1 addition & 1 deletion examples/dijkstraMap.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--[[ Rogue ]]
ROT=require 'rotLove/rotLove'
ROT=require 'src.rot'
movers={}
clr=ROT.Color:new()
colors={}
Expand Down
2 changes: 1 addition & 1 deletion examples/dividedMaze.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--[[ Divided Maze ]]
ROT=require 'rotLove/rotLove'
ROT=require 'src.rot'
function love.load()
f =ROT.Display(80,24)
dm=ROT.Map.DividedMaze:new(f:getWidth(), f:getHeight())
Expand Down
2 changes: 1 addition & 1 deletion examples/ellerMaze.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ROT=require 'rotLove/rotLove'
ROT=require 'src.rot'
function love.load()
f =ROT.Display(211, 75)
em=ROT.Map.EllerMaze:new(f:getWidth(), f:getHeight())
Expand Down
7 changes: 3 additions & 4 deletions examples/engine.lua
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
--[[ Engine ]]--
ROT= require 'rotLove/rotLove'
class= require 'src/vendor/30log'
ROT=require 'src.rot'

a1=class{lives=3}
a1=ROT.Class:extend("ActorOne", {lives=3})

function a1:act()
f:write('.'..','..os.clock(), 1, self.lives)
Expand All @@ -15,7 +14,7 @@ function a1:act()
end
end

a2=class{}
a2=ROT.Class:extend("ActorTwo")

function a2:act()
f:write('@'..','..os.clock(), 1, 4)
Expand Down
2 changes: 1 addition & 1 deletion examples/event.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--[[ Event Queue ]]--
ROT= require 'rotLove/rotLove'
ROT=require 'src.rot'
function love.load()
f=ROT.Display(80,24)
q=ROT.EventQueue()
Expand Down
2 changes: 1 addition & 1 deletion examples/iceyMaze.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--[[ Divided Maze ]]
ROT=require 'rotLove/rotLove'
ROT=require 'src.rot'
function love.load()
-- Icey works better with odd width/height
f =ROT.Display:new(81,25)
Expand Down
2 changes: 1 addition & 1 deletion examples/lighting.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ROT= require 'rotLove/rotLove'
ROT=require 'src.rot'

function love.load()
f=ROT.Display(80, 24)
Expand Down
Loading

0 comments on commit 84a0a7d

Please sign in to comment.