Skip to content

Commit 3704d25

Browse files
fized rendering in p5js
1 parent 0fc0d05 commit 3704d25

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

data/config.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
local config = {};
22

33
config.title = "brutopolis";
4-
config.version = "0.0.5a";
4+
config.version = "0.0.6";
55

66
config.mapSize = {x = 32, y = 32};
77
config.minRoomSize = {x = 5, y = 5};

entrypoint.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ function br.redraw()
3737
window.brout.player.position = window:Object()
3838

3939
window.brout.player.position["local"] = window:Object()
40-
window.brout.player.position["local"].x = br.player.position["local"].x -1
41-
window.brout.player.position["local"].y = br.player.position["local"].y -1
40+
window.brout.player.position["local"].x = br.player.position["local"].x
41+
window.brout.player.position["local"].y = br.player.position["local"].y
4242

4343
window.brout.player.position["global"] = window:Object()
4444
window.brout.player.position["global"].x = br.player.position["global"].x -1

index.html

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@
2323
createCanvas(400, 400)
2424
}
2525

26+
window.dobr = function(str)
27+
{
28+
fengari.load("br.bruter.eval('" + str + "')")()
29+
}
30+
2631
async function main()
2732
{
2833
//brutopolis code
@@ -73,9 +78,9 @@
7378
}
7479
for (let i = 0; i < window.brout.items.length; i++)
7580
{
76-
image(imgs[window.brout.items[i].name] || imgs["misc"], window.brout.items[i].position.x * 12, window.brout.items[i].position.y * 12, 12, 12)
81+
image(imgs[window.brout.items[i].name] || imgs["misc"], (window.brout.items[i].position.x-1) * 12, (window.brout.items[i].position.y-1) * 12, 12, 12)
7782
}
78-
image(imgs.human, brout.player.position.local.x * 12, brout.player.position.local.y * 12, 12, 12)
83+
image(imgs.human, (brout.player.position.local.x-1) * 12, (brout.player.position.local.y-1) * 12, 12, 12)
7984
}
8085
}
8186
main()

0 commit comments

Comments
 (0)