Log In  

BBS > Community Superblog
All Users | Following | GIFs | Postcarts | Off-site

Hello there!

I have been exploring Pico8 for over 2 years now trying to understand coding with let's say "some" progress.

But I'm stuck with Tables. I mean, I get the concept but there's something I haven't got to fully understand therefore I get mixed results.

So I created actors (player, enemy) as tables but I can't make them spawn several instances on screen. So far I have got to draw 5 enemies on stage (at random position) but they keep appearing all the time (where they should appear once), any light about what I'm doing wrong? here's the code:

--init
function _init()
--globals
wave=5
w=112
h=112

--player
pyr={
spt=1,
x=w/3,
y=h/3,
life=10,
spd=2,
flp=false,
idle=true,
}
enms={} --enemies

enm={ --single enemy

spt=10,
life=5,
spd=1,
flp=false,
idle=true,
draw=function()
spr(enm.spt,flr(rnd(w)),flr(rnd(h)))
end,
}

for a=1,wave do
add(enms,enm)
end

end

--draw
function _draw()
cls()
print(#enms,20,20,7) --checking created instances from enms table
foreach(enm,enm:draw())
end


I have read tutorials, videos and everything available but still I haven't figured it out yet :( Any help is much appreciated.

4 comments


BER
by Sness
Cart #berryleste-0 | 2020-03-06 | Code ▽ | Embed ▽ | No License
8

A mod of celeste where you play as a Berry named Bereline.

I was bored.

Here's another mod that I didn't want to make a whole new post for. It is for a friend and I would not recommend playing it.:
Actually I take that back, don't play it.

Cart #gioeste-0 | 2020-03-10 | Code ▽ | Embed ▽ | No License
8

8
7 comments


Cart #topifaname-0 | 2020-03-05 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA


Howdy ya'll. Maybe someday I'll make a full Cowboy RPG but for now, I just made a cowboy combat system.
Ride on!

0 comments


Cart #justpushthebutton-0 | 2020-03-05 | Code ▽ | Embed ▽ | No License
20

Digging up old Pico-8 jam games that were only on itch.io. This one was made for the Meta Game Jam 2018.

All you have to do is just push the button. It should be easy, although it's been a long time I didn't do it myself, so who knows? For example, the mouse no longer worked and I had to quickly patch keyboard to control pointer. Just use arrow keys, X and C. Hope I didn't mess things up. Coding is strange: you let everything for a while and when you're back, it's like functions have started a life of their own and nothing works like it used to be. Oh well.

The game runs at 60 fps, which is a bit demanding for the web player. For a better experience it is recommended you run it on Pico-8 (download the p8.png or just enter "load #justpushthebutton") or download the game executables from https://elgregos.itch.io/just-push-the-button.

[ Continue Reading.. ]

20
3 comments


Cart #kemobomb-2 | 2020-03-05 | Code ▽ | Embed ▽ | No License
29

Puyo with a twist: an arcade adventure with over 30 levels, and a unique soundtrack composed by Cello!

If you happen to like the game enough, completing the story will unlock Prestige Mode, where the campaign can be played again with increased difficulty.

29
12 comments


COVID-19 is an infectious disease caused by severe acute respiratory syndrome!

Those affected may develop a fever, dry cough, fatigue, and shortness of breath. A sore throat, runny nose or sneezing is less common. Cases can progress to pneumonia and multi-organ failure.

The infection is spread from one person to others via respiratory droplets produced from the airways, often during coughing or sneezing. Time from exposure to onset of symptoms is generally between 2 and 14 days, with an average of 5 days.

Those who suspect they carry the virus are recommended to wear a surgical face mask and seek medical advice by calling a doctor rather than visiting a clinic in person.

Wash your hands after playing!

Downloads over on Itch.io

Cart #covid19-1 | 2020-03-05 | Code ▽ | Embed ▽ | No License
7

[ Continue Reading.. ]

7
3 comments


Cart #lunar_blackout-0 | 2020-03-05 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

"Lunar Blackout"

279 characters

t,m,v,z,r,c,p=0,16,64,128,rectfill,circfill,pset::_::cls(1)c(99,24,20,7)r(0,v,z,z,0)for i=0,8 do
x=z-i*9y=abs(sin(i*.11))r(x,v,x+7,v-y*44,0)for j=0,z do
c((1+j%4)*t/9%z-i*5+j%63*m-z,m+y*4+j%2*m,6-y*2,2)end
g,h=i*m-t%m,i*32+t%32p(g,v,7)p(h,v)p(g+1,v,8)p(h-1,v)end
t+=1flip()goto _
0 comments


Stepped away from P8 for a while so I find myself a bit confused about the draw and update behavior.

I am trying to make a game where pieces fall and I am using cicfill to create these.

function build_pill(x,y,color,y2,color2)
	radius=2.2
	x2 = x - 3

	pill={circfill(x,y,radius,color),
				circfill(x2,y2,radius,color2)
		}
		add(pills,pill)

		return pill
end

I call it in update:

function _update()
	cls()
	build_pill(30,30,5,30,9)

end

The cls() function keeps erasing my object. However when I remove the cls() function the screen doesnt look right either.

SO

When is the right place to put the cls() and still be able to draw my shapes?

Thanks!

2 comments


WARNING Brief strobe effect in intro. More optimized code and small sprite improvements. Finally got around to adding the menu and sounds. Almost all of the updates after this will be additions to the rules and settings pages.

Cart #mukeheweji-1 | 2020-03-24 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
2

2
0 comments


Cart #unh-3 | 2020-03-08 | Code ▽ | Embed ▽ | No License
50

A Touhou fangame demake! As far as I know this is the first Touhou demake on the BBS, so I'm claiming that trophy :)

Use X for shoot / accept and Z for bomb / cancel and arrow keys for movement.

This demake has the following features:

  • 2 playable characters: Reimu Hakurai and Marisa Kirisame.
  • 4 enemies with a total of 16 spellcards.
  • 5 unique music tracks, which can be listened to in the Music Room.
  • A rudimentary score system.
  • A practice system, where each boss can be practiced against.

And the following mechanics:

  • Slow, your character slows down whilst shooting. How much you slow down depends on your selected character (33% speed for Reimu, 50% for Marisa).

[ Continue Reading.. ]

50
13 comments


Multicart is really a nice expansion feature, to offer content beyond the 32K boundary.
However, with reload not supporting BBS-hosted carts, large games are banned from BBS.

Is that something considered in the pico roadmap to bring back multicart games to the "official" forums?

Note that supporting more than a couple of data carts will require rework of the BBS file management.

  • support for upload many files at once
  • support for listing cart identifiers
  • support for headless export of p8.png (limited to html/bin at time of writing)
  • ability to assign same id pattern to many carts (ex: vracing_0... vracing_10)

Cheers

6
6 comments


Hi! So I was researching "cellular automata" to generate tiled caves using these tutorials:

https://gamedevelopment.tutsplus.com/tutorials/generate-random-cave-levels-using-cellular-automata--gamedev-9664
https://www.youtube.com/watch?v=v7yyZZjF1z4&t=755s

I found them super useful, until I went to write my own code in LUA (I'm a novice at programming in general, so I had some trouble). I managed to complete the first part-drawing random tiles on the screen: my version is the image below. I changed the background color to white (it looked nice) and randomly tiled the screen using tile ID 001 (dark blue tile).

I started having problems when it came to applying the smoothing function (make_step()). I always ended up with a dark blue, completely tiled screen. The code I wrote is below:

--init
function _init()

  x=0
  y=0
  --screen size
  width=16
  height=16
  --chance for tile to spawn
  wall_chance=0.5

[ [size=16][color=#ffaabb] [ Continue Reading.. ] [/color][/size] ](/bbs/?pid=73653#p)
1
6 comments


Cart #sonder-0 | 2020-03-04 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
2

"Sonder"

276 characters

b,z,x,y,d,r,g=0,128,{},{},{},rnd,pget
cls(0)::_::for i=0,z do
for j=0,z do
c=g(i,j)
if(c>0)pset(i,j,c-1)
end
end
for i=1,9 do
if(b<9)b+=1x[i]=r(z)y[i]=r(z)d[i]=r(1)
circfill(x[i],y[i],2,9)x[i]+=cos(d[i])*r(3)y[i]+=sin(d[i])*r(3)d[i]+=r(.1)-.05x[i]%=z
y[i]%=z
end
flip()goto _
2
0 comments


Cart #vitreous-0 | 2020-03-03 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
13

Vitreous is an arcade shoot-em-up made in PICO-8.

This game was created during a weekend game jam held by Warwick Game Design Society and LevelUp UK. The theme was "arcade", and games made for this jam will be showcased in an arcade to raise money for Special Effect.
The game jam's fundraising page can be found here.

Controls

Use the arrow keys and the Z or X keys to control the game.

Gameplay

Travel through all the zones to defeat the three bosses. Each loop through the game will get faster, so good luck. Collect 7 powerup objects to increase your weapon level. If you get hit, your weapon level will decrease by one. If you haven't got an upgrade to your weapon level, you will lose a life and need to restart the current zone. You will get an extra life for every 20,000 points you collect.

13
1 comment


Cart #pandemic-0 | 2020-03-03 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
1

"Pandemic"

265 characters

z,g,s,r,f=128,pget,pset,rnd,flr
cls(0)
for i=1,9 do
x=f(r(z))y=f(r(z))
s(x,y,8)
end
::_::
for i=1,z do
x=f(r(z))y=f(r(z))
c=g(x,y)
a=g(x+1,y)+g(x-1,y)+g(x,y+1)+g(x,y-1)
if(c>1)then
s(x,y,c-1)elseif(c==1)then
elseif(a>4 and r(a)>4)then
s(x,y,8)end
end
flip()
goto _
1
0 comments


This call, with only one arg after the string:

print("hello world", anything_even_a_table_or_function_or_nil)

Behaves oddly and in a way that is not documented in the manual. It renders the string at the cursor and then exits without updating the cursor. It doesn't seem to use the extra argument at all.

The only thing I can see this being useful for is a text countup display, as seen in oldschool memory tests during BIOS startup on PCs. I can't imagine anyone has ever actually used it this way, though.

It'd be far better if this case were treated as if the user wanted the text colored, but didn't want to specify x,y coordinates because they wanted it to work like a regular, scrolling print():

print("I'm blue, da ba dee, da ba die", 12)
10 comments


Hi all! I'm learning to use Lua as I make games, so this may have an easy answer. I just haven't figured it out yet:

Cart #thedustbbs1-0 | 2020-03-03 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA


edit:

I placed the actual cart here from a recommendation in the comments. I've placed every shape except for the cube shape somewhere besides the start of the file in the code (grid & photo are in spreadinit() and the rest can be found in the presets tab). The cube & grid show up fine, but everything else seems to be difficult to find for the program.


original post:

I'm currently making a game where there are several 3d objects you can peruse & rotate. I'm using the same function to display the objects as well as 3d grid to help me visualize where I should map everything--

[ Continue Reading.. ]

4 comments


Cart #bobsactionracing-1 | 2020-03-02 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
12

We are proud to present Bob's Action Racing - the PICO-8 port. Bob Fungus chose us to implement his most successful game ever to this great gaming console. Under his supervision and constant consultance we were able to create - he was able to create the greatest version of his game, yet. Through us. We were the tool.

Play the classic game on PICO-8! Race your car all the way to the end of the world. It will get fast. Very fast. Too fast. You will need to find a way to slow down. Maybe your fans will be of service...

Have fun! and please post your highscore!

Use left/right to steer, hold X or C to power-steer.

12
5 comments


Cart #packbat_parametric_demo-0 | 2020-03-02 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
1

Pretty straightforward: uses the feature of line() that it will draw from the end of the previous line to connect the dots around a curve defined parametrically (i.e. x,y both written as functions of t). Uses whatever the current pen color set by color() is.

Tried to build in some basic politeness features - it resets the draw state when it's done, it sets the sign on deltat to make sure that it points from t0 towards t1, it chooses a default value if deltat is given as 0 or not given, and it will always draw a line that starts at t0 and ends at t1 whether or not deltat is an integer factor of (t1-t0). With all of those implemented, it works out to 82 tokens; cutting all of those out drops it to 33 tokens. Haven't given this a bulletproof QA treatment but it passed some basic checks.

[ Continue Reading.. ]

1
0 comments


To use Tiled to create a PICO-8 map export from Tiled to a LUA file called "tiled.lua".

NB: You may need to make sure it's LF and not CRLF as current PICO-8 has issues including files using CRLF.

The following code will export the map and any spites in the cart to "tiled.p8".

function parsetiled()
#include tiled.lua
end
tiled=parsetiled()
layer,i=tiled.layers[1],1
for y=0,layer.height-1 do
 for x=0,layer.width-1 do
  mset(x,y,layer.data[i])
  i+=1
 end
end
cstore(0x0000,0x0000,0x3000,'tiled.p8')
2
10 comments




Top    Load More Posts ->