Log In  

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

Hello everyone.

As I strive to become better at programming, theres one thing that is annoyingly very recurrent in my code which are counters.

I have counters for playing a sound effect only when changing scene, or when a collision first happens.

I have counters to manage the speed of swapping animation frames

I also have counters just to tell the passage of time or trigger elements or behaviours after a while.

My general approach is: Create a global time variable with the name for the thing it's timing

animationcounter = 0

Then on update or draw I have some sort of

if animationcounter <= 20 then
   sp +=1
   animationcounter = 0
else
   animationcounter +=1
end

Is there a better way to do this that can be used for all counters necessary? With a function? or maybe an object where we instantiate counters or something?

1
7 comments


Hello! I just recently started messing around with pico-8 and am currently trying to make a fill detection function for a drawing game im working on

this function will take a 96x80 table (drawing_board) of either true or false values and will locate all enclosed loops of true values and fill them in.

My code works albeit very inefficiently (takes about 3 seconds with a sparse canvas) so any tips/suggestions to improve my functions would be greatly appreciated

-- Fill functions
function fill_enclosed_areas(drawing_board)
    local enclosed_areas = check_enclosed_areas(drawing_board)

    for i = 1, #enclosed_areas do
        fill_area(drawing_board, enclosed_areas[i])
    end
    return drawing_board
end

function check_enclosed_areas(drawing_board)
    local visited = {}
    local enclosed_areas = {}
    local enclosed_areas_coords = {}

    -- need to copy the drawing board to visited
    for x = 1, 96 do
        visited[x] = {}
        for y = 1, 80 do
            visited

[ [size=16][color=#ffaabb] [ Continue Reading.. ] [/color][/size] ](/bbs/?pid=156107#p)
2
5 comments


Cart #ghostvania1-8 | 2024-11-20 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
9

Controls :

O : Jump
O + UP : Throw subweapons (Requires hearts and you can throw multiple if upgraded)
X : Whip attack (Longer if you pickup the green upgrade)

Hello everyone ! Here is my latest game called Ghostvania, which is obviously an hommage to the Castlevania series but most specifically the first entry on the NES. I wanted to make it feel as close as possible as the first castlevania in the way it plays (difficulty, continues, lives, jumping, attacking, game loops, bosses).

So the story is you are a ghost and you are traversing the world of death. For that you need to go through portals but the problem is those portals are protected by creatures known as "Passage Demons". So embark on this adventure to help the ghost find it's way!

Have fun! Let me know if it's too hard or unfair, I would like to tune the difficulty. I tried my best to balance it.

And thanks for playing,

Au plaisir!

9
6 comments


mold wars

(256 chars)

o=14cls()n={peek(24322,o)}e=rnd
d=o for o=1,o do pal(o,del(n,e(n))+e{0,128},1)f=d 
d=2+e(62)\1*2pset(d,f,e(4))end
::▒::for o=1,2000do d=f f=2+e(62)\1*2
if(pget(d,f)<1)r=e(4)\1/4x,i=cos(r),sin(r)h=pget(d+x*2,f+i*2)pset(d,f,h)pset(d+x,f+i,h)
end flip()goto ▒
10
0 comments


Earth was not ready for her

(256 chars)

t=0d=64f=99n=circfill::🐱::?"⁶1⁶c0⁶!5f101ラ²ヲ◜◝ᶠ◜²\0⁷"
e=0for o=1,▤ do a=e e=(e~🐱)*3.1
o=(o-t*f)%f pset(d+e/o,d+a/o,9-o/11)end for o=2,d,4do c=d+cos(t-o/f)*30g=d+cos((t-o/f)*.7)*30r=3+o/2%6n(c,g,r,9)n(c,g-r/2,r/2.5,(o+t*f)%9)n(c,g-r/2,r/4,10)end t+=.01goto 🐱
6
0 comments


Cart #one_hundred_pico_8_pixie_dots-3 | 2024-10-29 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
4

As many around here I've found the four, current, issues of the PICO-8 fanzine beyond inspiring, so I designed my first semi-serious project to celebrate inventiveness of everyone involved in the platform.

P.S. If you've just discovered the series maybe don't look at #2 too intently :)

When you do, give all props to johanvinet, a true pixel art wiz.


The premise of a jigsaw puzzle is deceptively simple:

  1. take a fully formed picture

  2. scramble the pieces to make an undistinguishable mess

[ Continue Reading.. ]

4
4 comments




Hello!
How to change the current music pattern, while maintaining tempo?

In my game, I have my music looping pattern 0,1,2. When an enemy enters the map, I would like the pattern 4 to play, without loosing tempo. Ideally, the pattern change would happen on bar.

I have succeeded using function stat(407) to read the last track of my pattern and detect the beats. However, when I call music(4) inside _update() to switch the current music, the transition happens too late, and I hear shortly the beginning of the next bar of the current music, and then first note of the new music. In short, when stat(407) returns 1, it is too late to schedule a music change.

I would need a hook or callback in the music sync code to peek the timing, and post the music change exactly at the right moment to have smooth transitions. How to do that?

Thanks!

2 comments


Hey again!

I've recently assembled the raspberry pi powered pico8 game console that I have been showing off, and I'm proud to show that it is fully capable of running splore now! We still have quite a lot of tweaks to make before launch, but it's great to see it coming together. Now if you would excuse me as I go spend a couple of hours playing games...

I can't embed videos here, so checkout the reddit post for an actual gameplay video :))

2
5 comments


Cart #platformixel_maker_p8-1 | 2024-10-21 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
5


A quick phased platform editor, play challenges from other players and create your own maps to share.

Made for Pico8 as a prototype to develop my future games.

Shortcuts:
Left mouse button: Draw tile

Right mouse button: Clear tile

G: God mode.

I: Editor palette.

C: Character selector.

I: Activate manual(mouse) menu.

B: Save map.

M: Open/Close Minimap.

M+B (In that order): Clear map.

A, W, D, S: Movement keys.

Spacebar: Jump.

1,2,3,4,5,6,7,8,9,j,k,l: Tile editor selector.

Navigate through menu: Click on the gear, and select your menu or click on the gear again to close the menu.
Within menu, if you Left mouse button the cartridge option, it will save, if you Right mouse button, it will clear them map (reversible through Ctrl + R)

[ Continue Reading.. ]

5
1 comment


Cart #pool-0 | 2024-10-20 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

0 comments


Cart #swap_mouse-9 | 2024-11-25 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
20

Controls

Run: left, right
Jump: Z
Swap: X
Menu (restart options): P

About

Based on the pick up mechanic from Mini and Max in UFO 50, I made a sketch where a character swapped with walls. Then I kept working on it and here we are.

This thread started in the WIP forum, so the carts below are old builds you can inspect for historical purposes. The cart at the top is the latest version.

I consider this game finished, but it has about 2k tokens free, some map space, and some sprite space free for further experiments.

ORIGINAL 1ST POST BELOW...

Cart #swap_mouse-0 | 2024-10-20 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
20

[ Continue Reading.. ]

20
11 comments


This probably has a bunch of bugs and I'm not sure what it's good for, but, well, here it is anyway.

Cart #wavepaint-1 | 2024-10-20 | Embed ▽ | No License
11

Controls

  • Left click to paint with foreground color, right click to paint with background color. Same buttons to choose colors from the palette on the right.
  • Slider on the right controls brush size.
  • "x" button at bottom of right toolbar replaces whole scene with background color.
  • Ctrl-z to undo. Undo stack size is 16. (edit: This seems to be broken on the web build for some reason?? Works okay locally.)
  • Ctrl-p to replace canvas with wave-warped canvas. This is undo-able.
  • x key swaps foreground/background color.
  • Brush size affects wave height.
11
1 comment


Cart #star_pulse-1 | 2024-12-11 | Code ▽ | Embed ▽ | No License
3

THE STARS ARE COUNTING ON YOU!

Take control of the galaxy and crush your enemies without uttering a single word—show them who truly rules the stars!

HOW TO PLAY

  • Arrow Keys: Steer your ship
  • X Key: Fire your weapons

UNITE AND CONQUER!

Collect up to six stars to join you in battle and dominate the cosmos.

SOUNDTRACKS

  • Like Clockwork
  • Robot Dance

Both tracks are from the free pack Pico 8 Tunes Vol. 2.

WE WANT YOUR FEEDBACK!

Spotted a bug? Got ideas for improvement? Don’t hesitate to share your thoughts—I’d love to hear from you!

[ Continue Reading.. ]

3
1 comment


Cart #floppaspace-0 | 2024-10-20 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
6


Floppa in space in 256 colors

6
2 comments


Cart #flushy_fish-0 | 2024-10-20 | Embed ▽ | License: CC4-BY-NC-SA
2


CONTORLS:
UP - INCREASE TENSION
DOWN - DECREASE TENSION
X - PLAY AGAIN

2
0 comments


Any ideas on how to doodle something that sounds at least remotely like one?

2 comments




Cart #fujemajoyu-0 | 2024-10-20 | Embed ▽ | License: CC4-BY-NC-SA
3

How to reproduce:

  • use batch operations for tline
tline3d(ud:lerp(...))
  • notice that 0x300 flag for precision rendering is ignored
3
0 comments




Top    Load More Posts ->