Log In  
BBS > Lexaloffle Community Superblog
This is a combined feed of all Lexaloffle user blogs. For Lexaloffle-related news, see @zep's blog.

All | Following | PICO-8 | Voxatron | General | Off-site
[ :: Read More :: ]

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


Current world record is 4014 by @Ulexes . Can you beat it?

P#74101 2020-03-21 21:58 ( Edited 2020-03-23 04:00)
[ :: Read More :: ]

Cart #candy_colt-2 | 2020-04-11 | Code ▽ | Embed ▽ | No License
2


Squidkidd and Greyskull9 present:
CandyColt Classic

We made this game for a PIGSquad (Portland Indie Game Squad) for a summer slow jam.
The Creative Theme was "Occult Classic".
So we made a game about a colt!

My all-time score=375! Post in the comments your best score!

Have Fun!

P#74100 2020-03-21 20:03 ( Edited 2020-04-19 15:34)
[ :: Read More :: ]

Hi everybody!

So, for a jam I'm far too unskilled to have considered, I'm putting together a little game where up to four players can pilot tiny ships and defend a fort. The ships can move about, and (eventually) shoot in the direction of a target that can be rotated around the ship by holding a button. It looks like this in practice:

(Enemies and animations forthcoming.)

Right now, I am attempting to optimize the code, because the player inputs eat a LOT of tokens in their current form. I currently have four different sets of inputs, one for each player, and each also moves a target that is specified as its own object (target1 with .x and .y, target2 with .x and .y, etc.). This is obviously no good, given the immense redundancies.

I think one could probably code a generic input function by making each target a property of its ship, using something like this:

function input(p)
  if btn(0,p.c) then p.x=p.x-1 p.targetx=p.targetx-1         --repositions player and target
   if p.x<0 then p.x=0 end                                   --prevents leaving the screen
   if p.targetx<0 then p.targetx=p.x+radius*cos(p.a/360) end
  end
  if btn(1,p.c) then p.x=p.x+1 p.targetx=p.targetx+1         --repositions player and target
   if p.x>120 then p.x=120 end                               --prevents leaving the screen
   if p.targetx>120 then p.targetx=p.x+radius*cos(p.a/360) end
  end
  if btn(2,p.c) then p.y=p.y-1 p.targety=p.targety-1         --repositions player and target
   if p.y<16 then p.y=16 end                                 --prevents moving into sandbar at top of screen
  end
  if btn(3,p.c) then p.y=p.y+1 p.targety=p.targety+1         --repositions player and target
   if p.y>120 then p.y=120 end                               --prevents leaving the screen
   if p.targety>120+radius then p.targety=p.y+radius*sin(p.a/360) end
  end
  if btn(4,p.c) then end                                     --fires bullet (to be implemented)
  if btn(5,p.c) then p.a+=target_speed                       --rotates target
   p.targetx=p.x+radius*cos(p.a/360)
   p.targety=p.y+radius*sin(p.a/360)
   if p.a>360 then p.a=0                                     --resets target angle if needed
   elseif p.a<0 then p.a=360
   end
  end
end

Basically, as long as we specify the controller (c) associated with each player (p), we can use one function to dictate all player inputs. So, for each player, we have to put together a simple table of attributes.

And here is where my problem occurs: those stupid little targets.

Here's what I have tried to use for the first player's attribute table:

 p1={
   exist=false,
   dead=false,
   idle=true,
   x=50,
   y=50,
   a=180,
   idlesprite=3,
   movesprite=7,
   w=8,
   h=8,
   score=0,
   lives=3,
   c=0,
   targetx=p1.x+radius*cos(p1.a/360),  --PICO-8 doesn't like this line.
   targety=p1.y+radius*sin(p1.a/360),  --Or this one.
   targetsprite=16
   }

It seems PICO-8 doesn't accept putting p1.x, p1.y, and p1.a in those trig functions for p1.targetx and p1.targety. It raises an error, saying that they indicate an attempt to index a nil value. I guess I could just throw in a raw number for them? But I kind of need those variables, I think, since the location of the player's target must depend on the location of the player's ship.

TL;DR: A table isn't working like my noob brain would expect, and I have three questions:

  • Why are p1.x, p1.y, and p1.a nil values, if I already provide values for them in the table?
  • How else might I define targetx and targety, such that they remain properties of p1?
  • If the method I've proposed is stupid, what might you suggest as a workaround?
P#73758 2020-03-21 18:53
[ :: Read More :: ]

Cart #australis-3 | 2020-03-25 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
55

A penguin themed mod of Celeste Classic where you climb the Antarctic. :)

P#74099 2020-03-21 18:49 ( Edited 2020-03-25 07:06)
[ :: Read More :: ]

happy mother's day, clare!

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

P#74093 2020-03-21 16:47
[ :: Read More :: ]

Cart #ladderlad-1 | 2020-03-21 | Code ▽ | Embed ▽ | No License
21

You are Ladder Lad!

Traverse the ever-moving maze of runged objects and meet your fruit quota.

Arrow Keys - Move Ladder Lad

X Key - Pop bubble if you are caught in one.

Hot Tip: You can jump to the other side of the screen by going all the way to the left or right.

P#74087 2020-03-20 23:07 ( Edited 2020-03-21 14:24)
[ :: Read More :: ]

Cart #regolith_v024-0 | 2020-09-12 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
7

New version as of 9/12/2020 : Updated graphics, sound and movement controls.

Controls

Arrow keys move.
(x) to restart.

About

An asteroid mining roguelike.

You mine pink and yellow minerals for coins.
You mine blue water that is used as fuel for steam power.
You mine brown regolith for shielding against solar wind.

Moving to an asteroid starts the mining process.

The shield and fuel costs are designated as brown or blue numbers in the center map. When you cross the numbers, your shields and fuel are decreased that amount.

High brown numbers indicate intense solar wind. High blue numbers indicate distant asteroids.

Any feedback is appreciated.

Prior version v023:


Cart #rsv2_3-0 | 2020-03-20 | Code ▽ | Embed ▽ | No License
7

This is an update to the version posted here: https://www.lexaloffle.com/bbs/?tid=35489

@freds72 , @dw817 , @aquova : thanks for the feedback on the original. This version is attempting to make the game mechanics more obvious.

P#74080 2020-03-20 14:05 ( Edited 2020-09-12 23:22)
[ :: Read More :: ]

Hi,

I'm iterating over all map cells multiple times, to do various actions:

for t_x = 0, 127 do
    for t_y = 0, 63 do
        -- scan tiles
    end
end

for t_x = 0, 127 do
    for t_y = 0, 63 do
        -- do something
    end
end

for t_x = 0, 127 do
    for t_y = 0, 63 do
        -- place tiles
    end
end

This works, but uses a lot of tokens (do something is actually 4-5 different actions).

As there are a lot of interdependencies between cells, I can not do this:

for t_x = 0, 127 do
    for t_y = 0, 63 do
        -- scan tiles
        -- do something
        -- place tiles
    end
end

Instead, I wanted to do this:

functions = {
    scan_tiles(t_x, t_y),
    do_something(t_x, t_y),
    place_tiles(t_x, t_y),
}

for f in all (functions) do
    for t_x = 0, 127 do
        for t_y = 0, 63 do
            f(t_x, t_y)
        end
    end
end

But I never get the arguments passed to the functions I call.

How to go about this?

All help very much appreciated!

P#74068 2020-03-20 06:57
[ :: Read More :: ]

Cart #dokepyzi-0 | 2020-03-20 | Code ▽ | Embed ▽ | No License
12

P#74064 2020-03-20 00:41
[ :: Read More :: ]

I'm having an issue where it seems like I absolutely cannot pass an argument to a function, no matter what I do.

For starters, I am using doc_robs' famous hitbox function:

  function player_hit(x1,y1,w1,h1,
                      x2,y2,w2,h2)
   local hit=false
   local xs=w1/2+w2/2
   local ys=h1/2+h2/2
   local xd=abs((x1+(w1/2))-(x2+(w2/2)))
   local yd=abs((y1+(h1/2))-(y2+(h2/2)))
   if xd<xs and yd<ys then
    hit=true
   end
   return hit
  end

So far, so good, right? Then I pass the following arguments along to it from another function:

  if player_hit(p1.x,p1.y,pw,ph,star1.x,star1.y,sw,sh) then
  --stuff happens in here
  end

All of the values in the preceding if statement are defined at _init(). The values pw, ph, sw, and sh are all 2, defined as global variables. The p1 and star1 values come from tables.

But every time I run my program, this error occurs:

RUNTIME ERROR
   local xs=w1/2+w2/2
Attempt to perform arithmetic on local 'w1' (a nil value)

Now, I can't find the reason why w1 registers as nil. The value pw (2) should be subbed in for it, since it's being provided in the function call.

Strangely, the same error occurs even if I manually type "2" in place of pw in the player_hit() call.

P#74058 2020-03-19 23:20
[ :: Read More :: ]

Cart #miscom-1 | 2020-03-19 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
3

A kind of Missile Command.

P#74051 2020-03-19 19:49
[ :: Read More :: ]

If you grew up with the NES, you remember that their basslines had a certain "snappiness" to them (for lack of a better word). Here are two of my favorite examples:

DAT BASS!

Anyway, I've been trying to mimic that type of bass as closely as I can in my PICO-8 carts, but I haven't quite hit the mark yet.

Does anyone have instrument/effect suggestions for achieving this kind of sound?

P#73870 2020-03-19 18:22
[ :: Read More :: ]

You're gathering some cherry blossoms to make tea when oh no — the wind is blowing all the petals away! Use your fan to help guide as many petals as you can into your basket within 60 seconds.

Flower March is a short relaxing experience made for the Harvest Mouse Jam. It's our first PICO-8 game and was a lot of fun to make!

Programming by lambdaloop. Art and music by kcaze.

Music is "Rondo Alla Turca" by Mozart.

Cart #flowermarch2020-0 | 2020-03-19 | Code ▽ | Embed ▽ | No License
3

P#74041 2020-03-19 04:06 ( Edited 2020-03-19 04:08)
[ :: Read More :: ]

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

After a freak laboratory accident, ninja-in-training Nina finds herself trapped in an alternate dimension where the walls shift each time she jumps. Now she must collect the scattered gears to fix this shattered world and escape! But with 32 challenging stages to outwit, that will be no easy task...

hey all!! sol here. it's been a while since my last game, but I haven't been resting on my laurels. this time around, I've made a puzzle-platformer with a focus on fast gameplay and a novel mechanic-- each time you press the jump button, the walls will shift between the foreground and background! you can also cling to walls and jump off of them to reach greater heights. I've built a lot of really tricky puzzles around this, so I hope y'all enjoy!

I would also like to give a special shoutout to my testers, whom I owe a debt of gratitude for playing the earlier, more frustrating builds of this game. It's thanks to them that I can present this polished final version to you!

and of course, feel free to reach out to me either on these forums or on twitter if you have any questions or comments!

have fun and good luck!

P#74037 2020-03-18 19:33
[ :: Read More :: ]

I think it's too late to suggest this, since you appear to have completely filled the printable characters with the kana glyphs, but just in case there's something to spare somewhere:

I just used one of the unicode thumb glyphs (👎,👍) and realized it'd be handy to have such glyphs in the PICO-8 character set.

I drew up some possible 7x5 PICO-8 glyphs for them:

You could type them with -/+ in glyph mode.

Even if they can't be fit into PICO-8 itself, the thumb-up might be good for the BBS, because I think a lot of people don't realize that's what the ★ glyph on BBS posts is for, given how seldom it seems to be used.

(I guess it's not a big deal if this isn't possible, though, since we can obviously just draw them manually.)

P#74023 2020-03-18 01:48 ( Edited 2020-03-18 02:49)
[ :: Read More :: ]

This is probably a ludicrously simple thing that I never learned, so please forgive me in advance.

I'm trying to write a function that checks whether a thing (star1) moving in a circle intersects with any of four lines (four_p_lineX) that connect to the circle. The best way I can think to do this is to make the function check whether the X and Y coordinates of star1 match the X and Y coordinates of any of the line endpoints.

The thing is, PICO-8 doesn't like what I've written:

 function check_direction()
  local s1switch=flr(rnd(1))   --You wonderful forum people can ignore this part.
  if (star1.x,star1.y)==(four_p_line1.x1,four_p_line1.y1) or
                        (four_p_line1.x2,four_p_line1.y2) or
                        (four_p_line2.x1,four_p_line2.y1) or
                        (four_p_line2.x2,four_p_line2.y2) or
                        (four_p_line3.x1,four_p_line3.y1) or
                        (four_p_line3.x2,four_p_line3.y2) or
                        (four_p_line4.x1,four_p_line4.y1) or
                        (four_p_line4.x2,four_p_line4.y2) then
   if s1switch==1 then         --Ignore this, too.
    star1.line=not(star1.line)
   end
  end
 end

The above code produces the following syntax error:

SYNTAX ERROR LINE 187 (TAB 2)
 if (star1.x,star1.y)==(four_p_line1.x1,four_p_line1.y1) or
')' expected near ','

I can't really figure out what the error is telling me. Is it as simple as me forgetting some punctuation, or can I not make the comparison I'm trying to make?

P#74024 2020-03-18 01:11
[ :: Read More :: ]

This bug has not been fixed since july 2017: https://lexaloffle.com/bbs/?tid=29699

Maybe it's on AZERTY keyboards only, but it makes the SFX editor painful. Here's what this layout looks like: https://fr.wikipedia.org/wiki/AZERTY#/media/Fichier:KB_France.svg
The keyboard we frenchies use. Sorry. We love our diacritics.

  • the "6" key used for upper G# also decreases current pattern.
  • the "," key (right to "N") used for lower B also decreases tempo.
    Those are really annoying. There's also this which are a bit annoying but I can do with:
  • numpad "+" moves to 4 patterns forward while the "-" above moves only 1 backward.
  • "=" (left to Backspace) moves 1 pattern forward while underscore ("8" main key) moves 4 backward.
P#74021 2020-03-17 22:37 ( Edited 2022-04-20 06:48)
[ :: Read More :: ]

Cart #zuhihenit-0 | 2020-03-17 | Code ▽ | Embed ▽ | No License
1

Alt+Up/Down keys allow quick functions browsing in code editor, but oddly this is broken on the 3rd tab of my 5 tabs project, where alt+up/down won't go below the 2nd function (all other tabs are fine). Have no idea why, I even got rid of all my code & data to see whether this comes from that. This is the cart joined here: no data, only function names & some comments, but in tab 3 alt+down won't go under the parts_add function.

P#74019 2020-03-17 22:12
[ :: Read More :: ]

I've assembled the new Picade with a Raspberry Pi 4 inside. It boots on the NOOBS SD card, being myself rather a noob once outside of Windows :). Besides the recommended upgrades & updates, I've installed nothing else than the latest Pico-8 for Raspbian, as I want my Picade to be a Pico-8 machine first.

I launch Pico-8 with the command line and use splore to browse favourite games. Everything is fine until I relaunch games either by ctrl+R or the "run" command. And then it's the russian roulette: either the cart restarts, either it simply shut downs the whole Picade. Sometimes it happens after the 20th rerun or more, but this bug is so reliable I use it to turn off the machine instead of using the "shutdown" shell command.

P#74018 2020-03-17 21:43
[ :: Read More :: ]

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


Here is what you have all needed in your life to combat the lows, and be with you in the highs. Maybe you didn't know you needed it, but here, have a Corgi! :D

P#74007 2020-03-17 11:26
View Older Posts
Follow Lexaloffle:          
Generated 2024-03-28 22:23:33 | 0.116s | Q:82