hey so i have started making a rogue like and i started with dungeon generation, i am doing this by using Binary Space Partitioning(BSP) but when i go to process my binary tree it only takes the left route and not the right! it appears that the right route is always nil and i cant figure out why and i hope you guys can figure it out.
All help is appreciated!
-- d&!d
-- by anton wolfarth
state = 1
player = {}
-- player.[up,down,left,right] = {still, anim1, anim2}
player.down = {1,2,3}
player.up = {8,9,10}
player.left = {4,5,4}
player.right = {6,7,6}
rooms = {}
err = ""
gold = 0
function aabb(x1,y1,w1,x2,y2,w2)
return
end
function _init()
end
function _update()
if(state == 1)then
generatemap()
state = 2
end
if(state == 2)then
end
end
function drawrooms(room)
print(room.x .. ", " .. room.y .. ". " .. room.width .. ", " .. room.height)
--rect(room.x, room.y, room.x+room.width, room.y, room.y+room.height, 2)
end
function _draw()
cls()
foreach(rooms, drawrooms)
print(err)
print(#rooms)
end
-->8
-- map generation
function generatemap()
-- parent, left, right, depth, x,y,w,h
tree = {parent = nil,
left = nil,
right = nil,
depth = 0,
x = 0,
y = 0,
width = 256,
height = 256
}
makechildren(5, tree)
makerooms(tree)
end
function makechildren(maxdepth,parent)
xy = flr(rnd(2))
box1 = {}
box2 = {}
if(xy == 0) then
-- split by x
box1.width = flr(rnd(parent.width / 3)+parent.width / 3)
box2.width = parent.width - box1.width
box1.height = parent.height
box2.height = parent.height
box1.x = parent.x
box2.x = parent.x + box1.width + 1
box1.y = parent.y
box2.y = parent.y
else
-- split by y
box1.height = flr(rnd(parent.height/3)+parent.height/3)
box2.height = parent.height - box1.height
box1.width = parent.width
box2.width = parent.width
box1.y = parent.y
box2.y = parent.y + box1.height + 1
box1.x = parent.x
box2.x = parent.x
end
box1.depth = parent.depth + 1
box2.depth = parent.depth + 1
parent.left = box1
parent.right = box2
box1.parent = parent
box2.parent = parent
if(
box1.depth < maxdepth and
box1.width > 5 and
box1.height > 5
)then
makechildren(maxdepth, box1)
else
parent.left = nil
end
if(
box2.depth < maxdepth and
box2.width > 5 and
box2.height > 5
)then
makechildren(maxdepth, box2)
else
parent.right = nil
end
end
function makerooms(tree)
err = err .. tree.depth .. ", "
if(tree.left != nil)then
makerooms(tree.left)
err = err .. "l"
end
if(tree.right != nil)then
makerooms(tree.right)
err = err .. "r"
end
if(tree.left == nil and tree.right == nil)then
generateroom(tree)
end
end
function generateroom(leaf)
add(rooms, {
x = leaf.x,
y = leaf.y,
width = leaf.width,
height = leaf.height
})
end
|

| Pico8 use 2 functions to update stuff at a regular basis. One _update() function called every 1/30s (or 1/60s since the 0.1.8 version) and one _draw() function that do the same thing. |
That allow, for a project use that use the second as a time unit, to not slow down that unit.
From manual: _draw() is normally called at 30fps, but if it can not complete in time, PICO-8 will attempt to run at 15ps and call _update() twice per visible frame to compensate.
e.g., If I decide to make a sprite move from A to B in exactly 1 second but have a render process slower than 1/30s. I can put the move process in the _update function and the rendering in the _draw() function. The animation will not be smooth but the sprite will move from A to B in exactly 1 second.
This is true if the _update() function do not take more than 1/30s to execute.
This simple separation is only used for that purpose.
For my shmup project (bullet hell/danmaku) project, it's different.
Hello Pico 8 fam,
Been working on a game that is something of a Final Fantasy clone and I am trying to implement different rooms for the player to enter. I am stumped with how to get this going and was wondering if there were any good resources available for me to dig into.
I need a blank slate each time I enter a room.

This game was made in a week with the purpose of distributing it to try to get as many plays as possible. We're currently in the phase where we're collecting plays, so your visit is much appreciated!
It's also on itch.io! https://t.co/l3ExIHaRuI
Alas, it looks like the old (albeit undocumented) TIME() function has either been broken or deliberately retired, as it now always returns 0.
No doubt coinciding with the addition of the cool new clock features of v0.1.11c, which are very cool.
Sadly, this means there are a few tweetjams/carts that no longer function :o(
(using TIME() was a sneaky way of getting a linear number change with few characters!)
*pores a bottle for our fallen tweetcarts *
#TimeIsDead #LongLiveTheTime

Hi,
I was absolutely ecstatic to see we can now run pico-8 headless. Working on that tiny canvas is really exciting for me to make some twitter bots or something!
The problem is, not really surprisingly, it isn't "truly" headless. That is to say running on a headless OS results in an expected SDL error.
I was wondering if anyone had any tricks to get it running headless. For my processing twitter bot I used... xvfb? That might work in this case but it's a bit of a faff and I was wondering if anyone has had any success using a different path to get headless headless mode.

Hi there,
My copy of pico-8 isn't showing up as registered to my account, so I can't download the update which makes me SUPER sad. Anything I can try doing? I've found my Humble key and tried reentering it but it says it's already claimed (which, I mean, makes sense since I do have a working copy of pico-8).
Any help would be hugely appreciated. I also send an email last week to hey@
Thanks!
daggermoor

As far as I can tell, there isn't currently any way of downloading older versions of PICO-8 (or Voxatron, etc.) binaries. It could be very useful to have the older binaries available for testing purposes, such as the case of the user who posted that keyboard input stopped working on 0.1.11b for Raspberry Pi.
Would it be possible to keep an archive of historical binaries and changelogs for the sake of testing? Maybe a "previous versions" section in the Downloads/Updates area?
Thanks!
You are not the hero. You are dog.
This is a souls-like PICO-8 console game, playable in your browser or on the PICO-8 Fantasy Console.
A must for fans of Bloodborne, Dark Souls and Nioh.
The legendary matagi hero Snow Wolf is once again called for help, in order to rescue the mayor's children from the Yakuza, taken under dubious circumstances. A blizzard blows, and visibility is weak. Snow wolf sets out, with a sidekick, dog, in order to save the children and bring justice to the evil-doers. But by kami-sama is he so damned tired of all of this.
Snow Wolf is powerful. Snow wolf can kill his foes in a few blasts of his trusty rifle. But dog is just dog. Good dog :-)
[b]Game features:

Just started getting familiar with the PICO-8 music editor, it's surprisingly easy to work with once you understand the interface.
Update: Added PICO-8 cart, and changed music slightly. ;)
Update 2: Fixed more of the music, probably as good as it can get on PICO-8 at this point.
Recording on YouTube (old version now):
If you've never seen / heard of The IT Crowd, here's a video of the intro:
Maybe one day I'll incorporate this into a PICO-8 game. Let me know if you have any suggestions! ;)

This was a blast to make! I had one hour, from 2am to 2am when the daylight savings time change occurred. I managed to make the game in just under an hour. (I had, I think, 30 seconds left!)
The goal is to pick up all the orbs on the map in the time allotted. I'll be adding to this game from here, but it's a game! It has a win condition and lose condition.
Enjoy!
This is the final version of the below. In addition to all known bugfixes, (particularly a nasty one that had S and Z movement completely messed up), a new "Hidden" mode was added. Simply hold down X and Up when you start a game to access it. (Keep in mind, it is extremely difficult compared to the main game.)
The game can also now be lost! It boots you back to the title screen instantly when you do, but it shows you your grade.
1.0 Initial Release
1.0b Bugfix - Ranks S1-S9 were displaying incorrectly.
1.1 Changed - Floorkicks improved.
1.1 Changed - Hidden mode made easier on the eyes, and easier in terms of gameplay too.
1.1 Bugfix - Pieces no longer break the laws of physics and floorkick in mid-air.

After some googling, I figured out how to fix the sound for PICO-8 games on iOS. I wrote a small demo in this GitHub repo: https://github.com/nucleartide/fix-pico8-ios-sound
It might be that this is obvious to anyone who's experimented with PICO-8 on mobile... but lemme know what you think!






2 comments






