Log In  

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

Repro:

  • fire up PICO-8
  • switch to code editor
  • type something like 123456789 and hit enter
  • copy and paste that line few times to give yourself something to cursor through
  • using the keyboard, navigate to the middle of one of these lines
  • cursor up and down: should work normally
  • click near the start or end of the line
  • cursor up or down: will change the row properly but maintain the column from before the click

Demo:

This is probably as easy to fix as just setting both the current and virtual column on mouse clicks.

1
3 comments


So I find that organizing my code with data structures and functions adds a lot to the runtime cost in PICO-8.

For example, doing vector math with objects like {x=1,y=2}, and functions like

function vadd(v1,v2)
  return {x=v1.x+v2.x,y=v1.y+v2.y}
end

greatly increases the readability of my code, but at the cost of significant performance hit.

Coming from a C++ background, this really upsets me. Modern C++ compilers are extremely good at optimising, and it's often possible to write very expressive code with almost zero overhead. While in PICO-8, if I want my code to go fast, I have to write it in a rather repetitive and messy way.

I like how PICO-8 is deliberately restrictive, but is there a way to write clean code without hurting performance too much? What are your thoughts?

2 comments


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


A small cart I made with some simple movement that is very smooth.
It's left/right with up arrow for jump and down arrow for smash down.

3
0 comments


Cart #cyberbabble-1 | 2020-03-15 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
4

This is a work in progress puzzle game, in it there are just 7 levels to get a sense of the mechanics.

4
4 comments


i've been running into some strange errors involving a project using #include while running it on windows instead of my usual linux environment. i've isolated the problem to line ending convention: an external file that uses the windows CrLf convention, but is otherwise the same as a file that works with no problems, will cause errors. here is the text of the external file i used:

local function _draw()
    cls(1)
end

to see the problem, save this with an external text editor using windows line ending convention (wordpad works, as do many programmer text editors) and use #include to include it in a cart.

1 comment


The heavens receded like a scroll being rolled up, and every mountain and island was removed from its place. Then the kings of the earth, the princes, the generals, the rich, the mighty, and everyone else, both slave and free, hid in caves and among the rocks of the mountains. They called to the mountains and the rocks:

“SAVE US FROM THIS DEMON!"

.....

Score the number of the beast
to release the world from

PONGATORY!

Controls:

Left & Right to move.
X to serve.

Cart #pongatory-0 | 2020-03-14 | Code ▽ | Embed ▽ | No License
19

Check it out on itch!

[ Continue Reading.. ]

19
11 comments


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

Just experiencing with an "Impossible Game"- or "Geometry Dash"-like Prototype. Basic Gameplay works, but every other Thing is unfinished at this point^^.

14
4 comments


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

Turn with the left and right arrows keys.
If you fall to the ground you can restart the cart (⏸ -> "reset cart").

x=9y=9u=0v=0 function _update60()cls(7)v+=.07l=sqrt(u*u+v*v)a=atan2(u,v)
if(btn(0))a+=.014
if(btn(1))a-=.014
w=.03-cos(a*2)/50u=l*cos(a)v=l*sin(a)x=(x+u+8)%144-8 y+=v
if(y>120)u*=.9v/=-2y=120
for b=a-w,a+w,w*2 do e=x-8*cos(b)line(x,121,e,121,6)line(x,y,e,y-8*sin(b),0)end end

Annotated:

-- Position
x=9
y=9

-- Velocity
u=0
v=0

function _update60()
  cls(7)

  -- Gravity!
  v+=.07

  -- Convert velocity into polar representation (length and angle).
  l=sqrt(u*u+v*v)
  a=atan2(u,v)

  -- Input! Rotate the angle based on arrow keys:
  -- Left  -> counterclockwise
  -- Right -> clockwise
  if(btn(0))a+=.014
  if(btn(1))a-=.014

  -- Convert velocity from polar back into cartesian.
  u=l*cos(a)
  v=l*sin(a)

  -- Update position using velocity!
  -- x is wrapped around the edges. We could just use x=x%128, but then you
  -- would see the bird teleport at the edges. Instead we add 8px of buffer
  -- at each edge.
  x=(x+u+8)%144-8
  y+=v

  -- Simple bounce at the bottom of the screen.
  -- u*=.9 slightly slows the horizontal velocity
  -- v/=-2 reverse and halves the vertical velocity
  -- y=120 pops it back above the bounce breakpoint
  if(y>120) u*=.9 v/=-2 y=120

  -- The bird is drawn using lines that start at the current position and extend
  -- in the direction opposite of the velocity.
  -- We'll add/subtract w from the polar angle to get the different
  -- angles of the two lines.
  w=.03-cos(a*2)/50

  for b=a-w,a+w,w*2 do
    -- The x position of the tail.
    e=x-8*cos(b)

    -- The shadow
    line(x,121,e,121,6)

    -- The bird
    line(x,y,e,y-8*sin(b),1)
  end
end

36
10 comments


Cart #theninjawip-1 | 2020-03-15 | Code ▽ | Embed ▽ | No License


Version 1

This is my first project, I wanted to put it online to show my friends. If any poor soul stumbles upon this game 1. I'm sorry 2. if you really want any feedback would be nice.

Version 0

Cart #theninjawip-0 | 2020-03-14 | Code ▽ | Embed ▽ | No License

2 comments


Cart #dungeonsongtest-0 | 2020-03-14 | Code ▽ | Embed ▽ | No License
8

This is just a small loop I've been working on which I plan to put in one of my games, but thought I'd upload it to see what others think. It doesn't use any custom instruments and so far any additional layers I've attempted to add (drums, other melodies, etc.) haven't really sounded right. I'm curious if folks think this loop stands on its own enough or if it would become annoying to listen to after a while. Any general feedback is welcome.

8
7 comments


@zep

Right now if you want to draw a line loop with the cool line(x,y) continuation method, you still have to do at least one line(x0,y0,x1,y1) first to make it work:

-- draw a simple triangle
line(32,96,96,96) -- base
line(64,32)       -- right side
line(32,96)       -- left side

This isn't so bad if you're drawing the figure manually as I just did. But if you're, say, drawing an algorithmic figure's loop, you have to handle that first line conditionally within the loop:

-- draw a simple segmented circle
local cx,cy,r=64,64,32
for a=0,1,0x.01 do
  local x,y=cx+cos(a)*r,cy+sin(a)*r
  if a==0 then
    line(x,y,x,y) -- sets the continuation point
  else
    line(x,y)     -- continued from the last point
  end
end

Or (not shown) you can remove the condition from the loop, but it requires doing math to get the first point outside of the loop and then calling line(x,y,x,y) as above before looping over the subsequent points.

[ Continue Reading.. ]

5 comments


Have a nice birthday!
[0x0]
[0x0]

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

1
0 comments


With many thanks to packbat for helping me in the forum, I can finally say my first real cart is complete!

I give you: BASTARD SQUASH.

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

I don't have any training in programming or math, so this isn't as impressive as most debut carts. Still, we all have to start somewhere! I hope you find something to enjoy in it. Also, don't mind the unused sound samples, and general code inelegance...

Description

Have you ever thought your game of squash needed to hate you a little more? Then do I have a cart for you!

Your paddle shrinks with each successive hit. Past certain point thresholds, it also begins to creep toward the ceiling. Extra lives are granted every 300 points, because I love you, even if my game doesn't.

[ Continue Reading.. ]

0 comments


I'm looking for some advice on how to grant the player extra lives after the score crosses a certain point interval.

I've checked a few carts that do this, but I'm not able to make sense of the functions they use, and I was wondering whether anybody had a simple method handy.

At the moment, I only have a brute-force method. My cart uses two straightforward variables: "lives" counts the player's lives, and "score" counts the score. Let's say I want to give the player an extra life for every 300 points they score. Right now, I only have this:

function gainlife()
 if score=300 then
  lives+=1
 elseif score=600 then
  lives+=1
 elseif score=900 then
  lives+=1
 end
end

It kinda works (assuming the player loses interest in the game after around 1,000 points). But I figure there HAS to be a way to capture the interval in a neater function. Unfortunately, my stupid brain can't figure it out!

Thank you for whatever wisdom you have to share.

6 comments


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

Run it and watch the rubber band ball grow! That's it. Just a fun simulation.

Enjoy

-JH

2
3 comments


Cart #lowknight-1 | 2020-11-28 | Code ▽ | Embed ▽ | No License
281

For some reason, I forgot to post this cartridge when it was originally made during the 2018 Demake Jam. Well, here it is now! This is the minified version, but the .p8 source is available on the itch.io page: https://krajzeg.itch.io/low-knight.

The game is a demake of and a homage to Hollow Knight. It was made in 6 days, so it's kind of rough around the edges, and the difficulty level is over the top. It is what it is, though, and still happy with how well it holds up given its development time :)

281
40 comments


Cart #gamejamdor_gru_69-5 | 2020-03-28 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
3

This is a prototype from a gamejam that the some of the folks in CoNDOR Season 9 are participating in. We have 24 hours to make a game with the theme of "NecroDancer/CoNDOR/etc"

Update 2020-03-28

Spent more time after the GameJam was completed to flesh out more of the mechanics. Feels like most of it is in a good spot, outside of some weird collision stuff that I haven't spent enough time on.

Music, which is kind of the biggest piece of Necrodancer, is hard and I have no idea how to compose Memento Mori into anything resembling what DannyB or any of the other composers did. Maybe one day I'll figure it out.

If anyone is willing to take a stab at it, I'd love to have it in. Comment/reach out if you are interested.

3
0 comments


Once again using Dylan Bennett's Game Development with PICO-8 as the backbone, I've rolled out a new project based on his "Lander" recipe. Presenting Red Planet Mission:

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

I've tweaked the sprites, added a start screen (with art!), and managed to put together menu and gameplay themes.

I couldn't figure out how to randomize the star background each time you start up the game, but I'll keep trying.

It's quite exciting to have put all the features of PICO-8 to use in a cart! The next step is to do something using my own code next time.

0 comments


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

In classical cryptography, the Hill cipher is a polygraphic substitution cipher based on linear algebra. Invented by Lester S. Hill in 1929, it was the first polygraphic cipher in which it was practical (though barely) to operate on more than three symbols at once. The following discussion assumes an elementary knowledge of matrices.

https://en.wikipedia.org/wiki/Hill_cipher

I have added the space after the 'Z' in the alphabet so each symbol is represented by a number modulo 27.

0 comments


I'm back in 2020 with this 1980's Midway arcade unkonown remake.

Player play the base as stationay gunner. Defending
The base shooting enemy ships, fires coming from
Cardinal points, including a turn around enemy satellite thats
Is going to crash on ypur base.

Cart #birekupezi-3 | 2020-06-30 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
7

7
7 comments




Top    Load More Posts ->