I'm a novice programmer, and am fumbling my way through making a game in PICO-8. One of the things that I want to do in my movement code is only have 4 directional movement, not 8.
My movement code is:
function move_player() --walkleft if (btnp(0)) then px-=8 end --walkright if (btnp(1)) then px+=8 end --walkup if (btnp(2)) then py-=8 end --walkdown if (btnp(3)) then py+=8 end end |
I use btnp because I want tile locked movement in my game. This might be achievable with btn, but I couldn't figure it out. One big problem with this is the lag from the initial press to when it moves again from holding the button down. Also, if you hold both up/right, up/left, down/right, or down/left on the arrow keys the player will move diagonally. This makes sense, of course, but it's not what I want.
My problem is that I do not know how to achieve what I want. My first thought is something along the lines of only accepting the most recent button input, using elseif achieves something close, but directions take priority in the order they're written, not pressed. I'd appreciate any help.




Hi all!
This is my first finished PICO-8 cart.
Its an arcade game where you high five and fist bump cats.
High five the cats with your hand moving at speed for more points. Build up a combo to get a chance to pull off a secret handshake.
Controls:
Arrow keys - move hand
X - Switch arm position
C - Switch between open hand and fist
This is version 1.1 - I tweaked the hit detection for high fives and added a tutorial skill level.
Hope you enjoy it! :)


Moving on with the graphical adventure game, I wanted to create more appealing background details and give the view out the window in the scene more depth. I also wanted whatever I created to be reusable throughout the game. So I came up with a simple, customizable function that can be referenced at any point.
You can read more at http://whiteoutlabs.com/game-development/reusable-animated-clouds-for-the-pico-8/






Color tetris variant. Use â—„ â–º â–² â–¼ [O] [X] for controls. Some weird things can happen, but it's not always a bug, it may be a feature.
Change log:
Old versions:








In the spirit of sharing readable code, it should not cost tokens for things that only serve to make the code more readable. There are exceptions, of course, that can't be helped, where you might choose a short and less-readable algorithm over a more verbose one that does the same thing -- such as what I call the poor-man's ternary (c = a > b and 3 or 2) versus the "if" block (if a > b then c = 3 else c = 2 end).
Anyhow, back to the point, constants are one thing that serve no purpose other than to make reading and debugging easier. Thus, I feel, declaring a constant should cost no tokens in order to encourage the use of them. Referencing a constant, of course, should still cost a token.
Now, as most of you have already shouted out, the primary flaw with this proposal is that Lua does not support constants. Constant declarations would have to be added to the PICO-8 flavor of Lua which, well, is already not pure Lua. Furthermore, Lua was surely not imagined to be limited by tokens... so it seems fair to tweak PICO-8 Lua in this way in response to PICO-8's limitations.
Why?
Well, currently, I have 80 variable declarations (which are really just constants in their function) occupying 240 tokens. I am running out of tokens and want those tokens back from the constants. Thus, I will likely write a preprocessor (or modify @dddaaannn's excellent picotool) to strip out and replace the constants. I am marking my constants like this in preparation for that work:



This is the first stage of a WIP I've had in mind for a few days. Next up: PROCGEN, PICKUPS & ABILITIES.
old cart for reference: |


.png)

So, this is obviously an odd edge case, but I have the pico8.exe 0.1.10c binary pointing at /bin/pico8 in cygwin (win10).
printh works perfectly fine when supplied a log file target, but other than that, I don't get any output.
I know I could watch/tailf the log file, but I think this should work!
It works with windows Command Prompt, but the linux subsystem on windows is inferior in many ways.
Please support cygwin stdout!




View full site with screenshots here!
Ever want to play a game of Risk on the go? Here's the companion cart! Complete with six colors, units and dice.
- @josefnpat - Code, Design & Art
- @bytedesigning - Board Elaborations
Features
- Automatically set up a new 6 player game by using the menu option, "Setup New Game"
- Save & Load map, so you don't have to lose your progress!
- Quickly set or clear a country's player with O.
- Quickly set a country's units with X.
Tips
- Load this game on to your PocketCHIP to play anywhere!
- Countries can be set to Neutral for the Nuclear Risk gametype!
- Roll five dice by holding X and O. (To roll less dice, simply ignore the extra. To wait for defender to choose number of dice to roll in return, obscure the screen from the second player until the attacker's dice are announced)
A fast single-pixel particle system using bitwise operations and constant-time addition and removal. The top part of the program is the reusable particle system. It features acceleration, velocity, particle colors, and particle lifetimes. Please reuse, but please also keep my name attached to the code.
The bottom part is the waterfall demo and some generic particle emitter code.
You can save a few more cycles if you hardcode the gravity constant. Otherwise I believe that this is close to optimal.
More information at my github

Hiya - first post and I'm immediately asking for help. Tssk.
I'm drawing sprites to the screen, and some random colours are being displayed as black rather than the colour they are set to in the editor. However other sprites are displaying these colours correctly. Nowhere in my code do I use pal() or palt(), so although I'm assuming it's a transparency issue I don't see what I'm doing to cause it.
Thanks in advance



Hello lovely pico community!
This is my first game ever released and is still in development. But I enjoyed the local discussions so much so couldn't wait to share. This is a tribute to my wife's favourite childhood game. The goal is to defeat all the fruits going for you. Don't let them touch you! Dig the holes, lure fruits in them and then fill up the hole to defeat a fruit. Some fruits need to fall from higher ground to be defeated.



Testing out my Advanced Micro Platformer Starter Kit's ability to handle 16x16 sprites (vs more common 8x8 used in a lot of pico-8 games).
I ran the Dank Tombs demo cart on my PocketCHIP to find it really grinds...almost to a halt. I know the cart is pushing limits technically and the PocketCHIP isn't for every game - as much as I bang the PocketCHIP drum, I get it.
However, through that brief discussion, I learned that the PocketCHIP doesn't/can't run Pico-8 at full speed...??
Totally sucks given that PocketCHIP really pushes Pico-8 hard. And double stinks because as more people get their hands on Pico-8 and make great, top shelf games (like Dank Tombs) the PocketCHIP won't be able to keep up.
I had plans to make a console for Pico-8 using the Next Thing Console Bundle or maybe try to roll my own with a Raspberry Pi or something...however, if the PocketCHIP can't run things at full speed, does that mean these other devices can't either?
I want to play Pico-8 on my TV instead of on my computer so my kid and I can play without having to be in the office all the time. I've seen a lot of others post Pi consoles and such, which look like a great little project, but I want to make sure things will run as they should, unlike the PocketCHIP apparently.
Any thoughts, insight or first-hand stories is appreciated.








Concept:
This is my first real project on the Pico-8, it is a pretty simple game (kind of a 1 input game), based off rotation mechanics, it's pretty rudimentary yet I tried (and probably failed ^^'') to have a clean code, it has 31 one screen levels and uses the full tilemap space availiable on the cartridge, the code contains multiple functions, categorized under "level status", "drawing functions", "motion functions", "collision functions", and "game loop" (_init, _update and _draw). Even though the difficulty curve is kind of a fail I consider this game to be finished.
Commands:
Use (X) or (O) to change the rotation, and try to get to the end of the level (green square).
[b]Rules:




