Log In  
[back to top]


Yep, I'm still working on my Sprite/Flag routine.

Yet I left one of my other items running in the background in a separate Pico-8 tab last night, awoke to see that it said:

OUT OF MEMORY

Well the next morning I cleared the slate and started new code for it:

cls()
print"testing"
repeat
until forever

About 12-hours later it crashes and says:

OUT OF MEMORY

Now I don't think there's any recursion involved in this, but if it's running out of memory just by doing a loop, it could be a problem for others coders, right ?

And yes, I know "forever" is a NIL statement.

Nonetheless for it to crash, thoughts ?

0 comments



Cart #map2bbsimage-1 | 2019-09-28 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
2


To load this, in PICO-8 type:

load #map2bbsimage-1

[8x8]

[8x8]

[ Continue Reading.. ]

2
0 comments



as
by dw817
Cart #as-0 | 2019-12-31 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
3

TO LOAD THIS CART in Pico-8 immediate mode, type:

load #as]

(12-31-19) Added youtube video comparison.

It's difficult to emulate some of the wondrous things that are done in arcade games. One of which I was especially fond of is when Galaxian first made the scene as a space shooter. It had tiny stars that were colored and they flickered perfectly.

Here now is one function to do just that for you. Include in any of your space shooters. Just add to _draw() or _update(). Fire and forget. You don't even need code to initialize the stars as this is also covered in my one function.

Compare with original:
[youtube]tz9_1al9N70

[ Continue Reading.. ]

3
7 comments



Cart #str2board-0 | 2019-09-27 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
2

This program may not be too useful for you Pico-8 veterans but may prove instrumental to those learning the system or want an easy route to build their own mapper.

Obviously you can use the MAPPER if you want, but if you don't want to or can't, you may find this code to be of interest.

Here is the top of the source to show you what is going on in it.

As you can see it is a single string, 240-characters in length that uses only the special characters for Pico-8. If you check out the sprites you have:

Where you can replace each letter of the alphabet here with your own custom image. Then in the source editor, press SHIFT followed by that letter to enter in that character for the string in your board.

[ Continue Reading.. ]

2
0 comments



vvm
by dw817
Cart #vvm-6 | 2019-09-27 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
1


To load this cart, in Pico-8 immediate mode type:

LOAD #VVM-6

UPDATE: 09-27-19

  • Sped up load/save to external file process considerably by using internal temporary storage.
  • Converted loose initialize to function.

  • Added "Skeleton" file to make it easier for others to use. Includes the only 3-functions you need to make it work, but for loading and saving. Found HERE:
    Cart #vvm_skel-0 | 2019-09-27 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
    1

[ Continue Reading.. ]

1
0 comments



I had discovered where the configuration file for Pico-8 was for binary export and came across an option in there:

fullscreen_method 1 // 0 maximized window (linux) 1 borderless desktop-sized window 2 fullscreen

Whatever you do DO NOT choose option 2 and run your cart. I had thought hardware snap was a thing of the past but apparently it's possible to do in Pico-8. You do NOT want to choose this as your monitor literally SNAPS to try and match the hardware resolution - which mine couldn't so the whole keyboard and mouse locked up and garbage appeared on my screen of other previous window tasks.

Fortunately I managed to shut down my computer and reboot. In the past techniques like this could physically damage your monitor and definitely royally crash your computer.

ZEP may I wholeheartedly recommend you REMOVE this option at least for Windows executables. No Windows software today should ever need hardware snap with the advanced graphic cards we have.

12 comments



Hello.

Could someone help me with this please ? I'm trying to understand how this works.

var={}
var["playhp"]=500
var["playname"]="patrick"
var["wepname"]="dagger"
var["wepstr"]=2

for i in all(var) do
  print(i.." "..var)
end

And yes, I know I can use:

var={["playhp"]=500,["playname"]="patrick",["wepname"]="dagger",["wepstr"]=2}

But I want to be able to iterate each item per line and in any order, and the ability to remove them as well.

var["playhp"]=nil

And to recall a value: print(var."playhp") returns 500. And ability to recall a value be reference:

varname="playhp"
print(var.@varname) also to return 500.

And print(#var) to return 4, currently returns 0 (zero).

Thanks in advance !

[ Continue Reading.. ]

17 comments



Cart #yield_fireball-0 | 2019-09-22 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
3

You ever have that moment when somebody tells you something and you SORT OF get it but not really, and then later, maybe a day or two you cry out, "Ah ha !" because then you understand it ?

Well I'm not going to claim full knowledge of the YIELD() command, but I will tell you what it CAN do - at least for me.

I can take any program I've written to date and make it OOPS very simply.

Replace all FLIP() with YIELD(), then make a coroutine to run my MAIN() function. Done.

But it goes beyond this. Since I can now join the ranks of _DRAW() and _UPDATE() this means I can write a custom background engine that operates exactly as I like it.

[ Continue Reading.. ]

3
4 comments



Cart #implosion-1 | 2019-09-21 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
5

Years ago I had written a QBasic program for Gina in Taiwan. In it, it imploded the map of Texas along with a greeting. When you ran it, it had the pixels come from all sides of the screen to implode the image I put in there.

Now you can do the same thing in Pico-8 !

Create any picture you want, call initexplosion() then explosion(1,flag) Flag to 1 if you want to skip seeing the explosion and only want to calculate for it. Then you are ready. Now call explosion(-1,0) to see the neat implosion effect of the image you put in there.

5
0 comments



I first off wanted to let you know that I was just experimenting recording some .GIFs in PICO when I noted that the last .GIF I made was 6.49mb in size.

I loaded this up in VirtualDUB to check each frame in it, to make sure it looked alright, and then tried saving it back as an EXPORT .GIF to compare filesizes.

The filesize THEN was only 209k ! A 97% reduction !

I compared both. None miss frames, none have any distortion. They are the same EXCEPT that VirtualDUB has some massive compression going on there !

So ... Zep, someone, anyone ? the .GIF saver in current PICO-8 can definitely be optimized. No doubt about it. VirtualDUB was written 19-years ago - so it's not something new.

I can't upload the 6.49mb GIF in comparison here, says the filesize is too big.

Here is the 209k GIF though so you can see it's not missing anything. There's definitely good compression going on there !

[ Continue Reading.. ]

1
2 comments



Cart #xor_flower-0 | 2019-09-19 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
2

Years ago computers had very little memory. I am reminded of the Apple ][ computer which although having 2-HIRES graphic pages each 8192-bytes in size with a resolution of 280x192 B&W pixels, you only had about 16k of RAM space if you used both of them for your program.

The original method was to plot an image on one page while viewing the other, then swap the two so you were always plotting on one while viewing the other. Yet this technique cost two HIRES pages of memory.

So a new method was adopted to handle plotting sprites and graphics over existing static images, and that method was called XOR.

On the Apple for instance you could plot a shape with XOR dots, that is for every pre-existing black dot you plotted on, it would appear white. Likewise if you plotted on a previously existing white dot, the plotting color for your dot would be black.

[ Continue Reading.. ]

2
0 comments



Credit to MBoffin who inspired me to write this, mostly so I myself could prove that I understood seldom used Pico-8 command set of COROUTINES such as COCREATE(), CORESUME(), and YIELD().

Cart #cocreate_demo-0 | 2019-09-19 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
3

If you just want the source without the sound effects, that can be found HERE:

-- dw817's very simple
-- cocreate() program

function main() ------------->>

cls()

init=0

repeat

-- if press (x) or this is the
-- first time to run,
-- prepare for being able to
-- call function "act" as a
-- co-creation
if btnp(5) or init==0 then
  init=1

-- make a pointer for the
-- cocreation function "act"
  go=cocreate(act)
  sfx(0) -- low pitch
end

-- if press (o) then call
-- routine here to plot three
-- circles, one at a time, and
-- one for each press
if btnp(4) then
  coresume(go)
end

-- update screen
flip()

until forever
end --<<-----------------------

-- three circles, click (o)
-- three times to see all three
function act()
  circfill(10,10,10,5)
  sfx(1) -- high pitch

-- each time yield is used,
-- the position of where the
-- program is in the function
-- is recorded and the function
-- exits
  yield()

-- the second time you press
-- (o) the function will start
-- here, not at the beginning
  circfill(20,10,10,6)
  sfx(1) -- high pitch
  yield()

-- as above, this function
-- starts here on a 3rd press
  circfill(30,10,10,7)
  sfx(1) -- high pitch
  yield()

-- there is nothing more here
-- so pressing (o) a 4th or
-- more does nothing.
-- you must call cocreate()
-- again in order to reset
-- this function to start
-- running the 3-circles again
end

main()

[ Continue Reading.. ]

3
4 comments



My Father died nearly 20-years ago from today. Outside of my Sister and my Step-Mom, they are the only family I have now.

I remember my Step-Mom sending me the classic poem from Robert Frost.

And I remembered ... I remember when I was young.

https://www.writerscafe.org/writing/dw817/1260511/

So ... in tribute, I have two programs. One is to try and recreate that very program for the TRS-80 I typed in those so many years ago - and to have it run at the same speed.

Cart #siparefiti-0 | 2019-09-17 | Code ▽ | Embed ▽ | No License
8

The other is something a bit more magical. A year after the funeral I wanted to make SNOW, real snow, on the computer, and as accurately as I could. A majestic tribute to my Dad and that program typed in from so many years ago.

[ Continue Reading.. ]

8
8 comments



I have never really liked to write code in BlitzMAX despite the fact it can work with a screen of 1980x1080 with true 64-million color pixels for a very simple reason. It takes time to compile the code and test it.

About 5-seconds to be precise, and that includes finding errors, even for a 2-line program.

My programming style if you are curious is a little like a rabid rabbit. It's like I take a cracker, nibble on it, look at it, nibble on it, look at it again, and nibble a little bit more.

That is - I write a bit of code, run it, add a bit more, run it again, then add a bit more.

My Dad was the opposite in that he could sit down and write a flawless program from beginning to end and NEVER have to run it once until he knew it was completely done. I can't do that.

So ... Pico-8 is a bit of my friend now for as you know when you RUN or press CTRL+R the language is already off like a shot and running.

Therefore I decided I could use it to write my Pico-8 website of favorite games.

[ Continue Reading.. ]

8
9 comments



The more I've been experimenting with the #INCLUDE command, the more I'm realizing that when you compile to an executable that - well ... you're not.

You can test this quite easily by using my homebrew Pico-8 compiler.

It's very simple.

-- external p8 compiler
-- written by dw817

-- note: you must compile this
-- program to exe in order to
-- use it

cls()
repeat
  flip()
until forever

First, type out this code in the P8 source-code editor. Don't add anything else.
Save it. Run it. Press F7 for a screenshot even though nothing is there.

Now remove those 3-lines of repeat, flip, and until forever.

Go to sprites, mapper, sound, add stuff if you want. You don't have to.

When you're done with that, return to the sourcecode and add just below cls() the line:

#include source.txt

Now save this to a filename as a normal .P8 first. You'll get a warning that "could not #include file: source.txt". But don't worry about that. It worked. Then export as an EXE.

[ Continue Reading.. ]

2
5 comments



Zep, your front page HERE:

https://www.lexaloffle.com/pico-8.php


When I click on any of the games, the middle screen stays dark and does not load any game as intended.

I'm using Windows 10, 64-bit, Firefox Quantum v69.0.

If it doesn't work here chances are it doesn't work there for someone else. Thought I'd let you know ...

. . .

Solved. Just needed to clean the internet cookies for Firefox. Runs well here now.

3 comments



Hello.

Now that I've learned where the files are located, I've started to put together a little engine for myself that can create a nice list of Pico-8 games.

Here is what I've done so far:

https://dw-817-blog.tumblr.com/
sorry, had to shift some things around.

Hover over the cart to get a brief description and list the author.

Unlike embedding once you click the game it goes straight to the post in Lexaloffle where the game was released so not only can you play the game but read the author's comments, comments and questions from others, if you're logged in get a chance to add your own comments.

Special thanks to kittenm4ster and BoneVolt for their excellent programming and carts in the current list.

If it all looks okay, feel free to reply and post your game information and I'll add it to the list.

All I need is the URL address of where your game is (in Lexaloffle), it will look like this:
http: // www . lexaloffle.com / bbs / ?tid=00000

[ Continue Reading.. ]

3
4 comments



Hello. As you know I've been recently experimenting with the new #INCLUDE command.

I have now recently found that if you use PRINTH it APPENDS text to a file, it does not overwrite it. If there is some way to overwrite the data, then this program could be run more than just a few times.

BUT IT DOES WORK.

You can indeed load a text file as data for PICO-8. Modify it. Save it back. Then re-run the program to see all the changes recorded without having to save anything to SRAM or 256-byte storage.

One problem I ran into is that #INCLUDE can also not be used in a comparison. For instance, this:

IF 1==0 THEN
#INCLUDE DOESNOTEXIST
END

Will crash because it ignores any commands around it and WILL INCLUDE that data if it exists and crash if not.

Here is the program. It does work a few times. Can you make it so it's perfect and can be run over and over again ?

-- test load and save text file
-- by dw817

cls()
game_name=""
game_x={} game_y={} game_r={}
game_c={}

#include gamedata.p8l

repeat
cls()
print("name="..game_name)

for i=0,15 do
  circ(game_x[i],game_y[i],game_r[i],game_c[i])
end

color(6)
print("",0,90)
print"left for new name"
print"right to clear name"
print"up to clear circles"
print"down to create new circles"
print"press 🅾️ to save"

flip()

if btnp(⬅️) then
  game_name=""
  for i=1,3 do
    r=flr(rnd(17))+1
    game_name=game_name..sub("bdfghjklmnprstvwy",r,r)
    r=flr(rnd(5))+1
    game_name=game_name..sub("aeiou",r,r)
  end--next i
elseif btnp(➡️) then
  game_name=""
elseif btnp(⬆️) then
  for i=0,15 do
    game_x={} game_y={}
    game_r={} game_c={}
  end
elseif btnp(⬇️) then
  for i=0,15 do
    game_x[i]=flr(rnd(128))
    game_y[i]=flr(rnd(128))
    game_r[i]=flr(rnd(16))+16
    game_c[i]=flr(rnd(15))+1
  end
elseif btnp(🅾️) then
  t=""
  t='game_name="'..game_name..'" '
  for i=1,4 do
    t=t.."game_"..sub("xyrc",i,i).."={"
    for j=0,15 do
      if (i==1) v=game_x[j]
      if (i==2) v=game_y[j]
      if (i==3) v=game_r[j]
      if (i==4) v=game_c[j]
      if v!=nil then
        t=t..v
        if j<15 then
          t=t..","
        else
          t=t.."}"
        end
      end
    end--next j
    t=t.." "
  end--next i
  printh(t,"gamedata")
  sfx(0)
end

until forever

[ Continue Reading.. ]

4
5 comments



There are not too many string-handling libraries I have come across in Pico-8. And for visual text this is not too surprising considering the small-size of the screen. :)

However, the point of this cart is to demonstrate a few things. One of which is that it is indeed possible to load a text ".txt" file inside your program. Now unfortunately the TXT file's contents cannot be changed once loaded. Like if you made a loop to view the contents each time.

But this does free you to use any other editor like NOTEPAD to prepare text data inside it.

For instance, you will need this. Highlight all of it, press CTRL-C. Bring up NOTEPAD. Press CTRL-V. Then save it on your HD as YUKON.TXT in a place you normally save your PICO-8 carts.

text=[[

Day had broken cold and grey, exceedingly cold and grey, when the man turned aside from the main Yukon trail.
It was a steep bank, and he paused for breath at the top, excusing the act to himself by looking at his watch.
It was nine o'clock.
There was no sun nor hint of sun, though there was not a cloud in the sky.
It was a clear day, and yet there seemed an intangible pall over the face of things, a subtle gloom.
This fact did not worry the man.
He was used to the lack of sun.
It had been days since he had seen the sun, and he knew that a few more days must pass before that cheerful orb.
The man flung a look back along the way he had come.
The Yukon lay a mile wide and hidden under three feet of ice.

]]

[ Continue Reading.. ]

4
1 comment



[8x8]

Was thinking of some things I'd like to see in future PICO. Reiterating the post as quite a bit has changed since its initial writing.

Some of these suggestions are possible, others are not. What are some of your suggestions that you think would be acceptable for the next update in Pico-8 ?

Going to start latest suggestions as replies to this thread as this one post has gotten rather large.

Here we go ! First off, 2 errors:

!! Fix parenthesis error. This gives error: IF (K=="(") X=X-1 ... gives error because parenthesis is character to check.

!! Fix error with modulos when using high negative numbers. ?-32767%10000 yields 7233, incorrect.

[ Continue Reading.. ]

1
11 comments





Top    Load More Posts ->