Log In  

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

How can I choose a variable as an argument in a function? Why doesn't this work? And what can I do instead?

timer=1

function updatetimer(i)
	if i<300 then
		i+=1
	else
		i=1
	end
end

function _update()
	updatetimer(timer)
end

function _draw()
	cls()
	?timer
end
4 comments


@zep, I am finding this line by itself in code:

while a < anything do

while a < anything do

Is not appearing entirely ^^ above in [ code ] if you take out the space before and after the <
This is happening in PREVIEW. Once I post I'll let you know if it appears as a POST too.

This is quite puzzling. I also have my ad-blocker turned off.
Windows 10, Quad processor, Firefox v105.0.1

while a<anything do

while a<anything do

O K A Y it only happens in PREVIEW. Here, create a new message and copy that while a<anything do inside [ code ] and PREVIEW your message before you post. See if you get the same results I do.

This is what I see when I PREVIEW the message:

Please let me know if you ARE or ARE NOT receiving this error on your side.

1
0 comments


Working on trying to understand RLE and I found a simple algorithm which I converted to pico-8 lua. When I run it however it seems like the while loop exits and executes the next line of code every iteration even though the conditions are still being met. I'm not sure what is going on, but I am sure that it is my fault. :D

cls()
string='wwwwweehhhhhhhjjiiioop'

function print_rle(str)
	local string=str
	local n=#string
	local j=0

	for i=1,n do
		local char_count=1

		while i<n-1 and sub(string,i,_)==sub(string,i+1,_) do
			char_count+=1
			i+=1
		end
		print(sub(string,i,_)..char_count,8*j,10,7)
		j+=1

	end	
end

print_rle(string)
8 comments


A few weeks ago I asked for help for a game, but seeing that Pico 8 is very expensive for what it is, I decided to cancel the "wonderful game" that I was going to present to you with love.

Sorry for putting high expectations, it motivated me to make a game, thanks for putting your contributions.

2 comments


Taking a crack today at building drum kit SFX - I've labeled this one as a "High Tom", but if you play it on a lower note than C2, I think it'll probably serve for whatever tom you need. You do need to take care of fading out the notes yourself, though - the SFX ends on a held G1, just to let the drums have a longer sustain than 32 ticks.

[sfx]

1
1 comment


Cart #bigahuwiwa-4 | 2023-09-30 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
36

30/09/2023 UPDATE
I've had an updated version of this cart on my hard drive for ages that I've never uploaded so I thought I'd finally put it out there.

Just a small mod, mainly a texture tweak.

  • Updates a lot of textures to be closer to the ones in 2018 Celeste
  • Adds a unique tileset for each of the 3 sections of the game
  • Updates some existing textures to make them slightly nicer to look at (imo)
  • If you beat the game with 0 deaths, the game will reward you with a golden strawberry!

Thanks to Maddy Thorson and Noel Berry for making the original cart.

36
17 comments


Cart #majodonuya-0 | 2022-10-04 | Code ▽ | Embed ▽ | No License
13

13
11 comments


i found a game where you are a white cube trying to make other white cubes trying to crash into each other. i am trying to make a game like this but cannot find the original to base it off of? do anyone know what it is called

11 comments


Cart #habunakute-3 | 2022-10-04 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
2


Cart #habunakute-1 | 2022-10-04 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
2

just learning

2
1 comment


Snek

Controls

Press X to start the game
Use the arrow buttons to move the snek.
Press O to pause the game anytime.

Cart #gehajwepi-1 | 2022-09-06 | Code ▽ | Embed ▽ | No License
1

1
4 comments


Flop Birb

This game is a Flappy Bird clone made 100% from zero by me, with my own twist on some features. Hope you enjoy it!!

Objective

Don't flop.

Controls

Press X to start the game
Press X to jump
Press X to revive

Cart #murihibumo-0 | 2022-10-04 | Code ▽ | Embed ▽ | No License
3

3
4 comments


This is in direct response to @packbat's marvelous MIDI collection.

I didn't choose a number cause I don't want to overwrite a number you already had.

I have not heard a really good synthesizer instrument yet so I decided to listen to one of my favorite music authors, Vangelis, and the lovely instrument he did in the opening of "Five Circles."

Here is my attempt to recreate the 1st note in the song "Five Circles" - as played by Pico-8.

Cart #synthesizer_note-2 | 2022-10-04 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
5

Compare with the original:

https://www.youtube.com/watch?v=TmlS5riwapM

The third sound, (sfx 5 where you press UP) is my submit for both midilib and denote.

5
9 comments


Cart #iwokeuphere-1 | 2022-10-04 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
5

I found this spoooooooooooky thing I made a few Halloweens ago.

Just like the videotape in The Ring, if you don't make someone else play this within 7 days, bad stuff is gonna come for you! Don't try to avoid your responsibility to pass this on, I'll know (because I have access to the play count stats).

The exit is on the left. Arrow keys/d-pad to move . . . while you can.

5
6 comments


I have completed my first ever PICO-8 game for the Ludum Dare 51 game jam!

The theme was 'Every 10 Seconds'. Our game is about a cat with 9 lives who must survive different obstacles for 10 seconds.

Cart #ld10seconds9lives-0 | 2022-10-03 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
11

11
6 comments


The trouble with the General Midi 1 standard is that it doesn't include any explanation of what any of the names mean, so I had to spend multiple seconds of research on going to the GM-1 Wikipedia page and scrolling down to the best guess of the editors there. Apparently, by "SynthStrings", they probably mean a string synthesizer, or string synth, an electronic instrument originally intended as a relatively cheap and portable substitute for a strings section, but which people later started to use as an instrument in its own sake.

So, that's what I tried to imitate. And since GM-1 has two SynthStrings program numbers and says nothing about how they should differ, I just tried to follow what GeneralUser GS seemed to do and make the second version a little brighter in timbre.

Here's 050 SynthStrings 1:
[sfx]

[ Continue Reading.. ]

5
4 comments


Cart #robooletjaut-0 | 2022-10-03 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
1


Hi!
For posterity's sake i'm uploading my previous creations onto here.
This was created for GMTK Jam 2022: "Roll of the dice"

...So basically it's yahtzee with items.
Happy Jauting!

1
0 comments


Cart #stripper-1 | 2022-10-03 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
3

(v01 10-03-22)

TO LOAD THIS PICO-8 CART, in immediate mode, type: load #stripper

Hello.

In lieu of this post:

https://www.lexaloffle.com/bbs/?tid=49612

I have since written a utility to remove all extraneous spaces in your source-code.

NOTE: This program works online as well as offline.

To use it, either run it and read the directions or press a key to continue.

From there press ALT-TAB to choose the Windows task that has the Pico-8 code you want to fix.

Press CTRL+A and CTRL+C to highlight and copy it all to the clipboard.

Press CTRL+V back in my program.

It will be pasted and examined. Any leading spaces on your code will be tallied and truncated.

[ Continue Reading.. ]

3
5 comments


Cart #robooletld51-0 | 2022-10-03 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
7


Hi folks!
I've been using PICO-8 for a little bit now, but i never got around to making an account and posting my stuff here

Anyways, i made this little survival platformer for the ld51 compo, theme: "Every 10 seconds"
Hope you enjoy!

7
3 comments


Cart #sheeple-0 | 2022-10-03 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
9

Made for Ludum Dare 51.

About

Join the flock!
Thoughts are invading your mind. What are these carvings? Did I make them or have they always been there? Nevermind, the sun is bright. Best to enjoy the day with your sheep mates…

Keep em guessing
Sheep curling might become a thing!

Limits & Theme

Plan was to add 10 second requirement to keep the dark lord at bay. It did not happen. At least the theme contributed in making up the premise for the game. Became a pretty short “experience“, but it worked quite nice with the short time.

[ Continue Reading.. ]

9
5 comments


Cart #dojoyuduwi-0 | 2022-10-03 | Code ▽ | Embed ▽ | No License
1

This is another problem I run into, @zep.
Examine the code. It's empty, right ?

But no, if you load it up and check info() you will see that it takes 736-characters in space.

So what is going on here ?

Clearly Pico-8 is not truncating spaces. And how many times have you run into this ?

  variable=value

A line in your code and you go up to change it when you realize you have 2- or more spaces are at the end of the line. Naturally you backspace over them, but this can be tedious if you have done this in other parts of your code - and it DOES count against your 65535-character total.

May I suggest future Pico-8 automatically truncate empty spaces on the end of code when loaded, when saved, when edited, when typed, and when the cursor matches its vertical position. Also check and truncate prior to the programmer pressing the ENTER key for a new line.

[ Continue Reading.. ]

1
0 comments




Top    Load More Posts ->