Log In  

BBS > Superblog
Posts: All | Following    GIFs: All | Postcarts    Off-site: Accounts

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

[ Continue Reading.. ]

2 comments


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.

[ Continue Reading.. ]

0 comments


Cart #45992 | 2017-11-08 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
2

made in like 2.5 hours. it's also my first pico-8 thing.
there are bugs.

2
0 comments


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.

1 comment



1
0 comments


Cart #45966 | 2017-11-07 | Code ▽ | Embed ▽ | No License
2

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

2
0 comments


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

3 comments


the new instrument system does that, but only from the tracker...

2 comments


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.

3 comments


Is it possible to get the current Camera position stored in the DrawState?

I'm writing my own map() function, and want to hook into the built in camera functionality.

Thanks!

1 comment


Here's a simple one:

Cart #45944 | 2017-11-06 | Code ▽ | Embed ▽ | No License
16

use stat(x), where x is:

80..85 UTC time: year, month, day, hour, minute, second
90..95 Local time

Go crazy, guys!

16
16 comments


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

1
4 comments


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!

0 comments


Cart #45924 | 2017-11-06 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
1

Simple testing cart to test FPS on device.
Can adjust update and draw payload to see how often _update60 and _draw functions are called depending on their slowness.

1
0 comments



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:

[ Continue Reading.. ]

4
1 comment


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.

Cart #46946 | 2017-12-02 | Code ▽ | Embed ▽ | No License
5

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! ;)

5
5 comments



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!

4
0 comments


Cart #45888 | 2017-11-05 | Code ▽ | Embed ▽ | No License
1

My FC_JAM #2 submission, and my first time messing with Pico-8. Pretty fun!

Top-Down Slippery Car Action. Destroy the cores to progress through the stages!

1
1 comment




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.

[ Continue Reading.. ]

5
6 comments


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!

1
8 comments




Top    Load More Posts ->