Log In  

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

When the AI plays itself in my game, it is too much for the _update() so PICO-8 drops _draw() frames. The moves are correct, but its awkward because both pieces move at once.

How do I remedy this? Is it a coroutine I need? I've been playing with them and have gotten some crazy results, not really knowing what I am trying to accomplish. But is that even the right approach?

Or can I make some kind of delay between moves to give the cpu time to catch up? I tested by making it only run the engine after a button press and it works fine.

I also tried calling flip() explicitly after the resource-heavy function but no dice.

any pointers are appreciated.

2 comments


Cart #escapefromlabszero-2 | 2024-11-30 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
3


Hey folks!
This is my first time using pico 8 and my first cart! It's an auto-battler where you make decisions on who to add to your team. Units have various combat styles, and some have non combat abilities as well.

Edit: Updated cart, found logic error in the cheetah, it is now a glass cannon just as I designed :3 And changed sprite colours of wolf to make it stand out from the porcupine.

3
2 comments


Cart #dekasimiha-1 | 2024-11-29 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

The Free Lands, which has an ID of dekasimiha, is a "sandbox" game for Pico-8 where you can mine trees, explore castles, see ruins, find gold, collect enough keys, and destroy enough bosses to win! The game is in its early Beta stages, so don't expect much.

Features added in v1.3.2 (the latest): New keys, new areas (castles and ruins), a battleaxe added to the game, inventory expanded to tools, a new "tutorial" area that explains some mechanics and the game, and a new tree texture.

If you play this game and want to become a "registered" beta tester in the credits (once those get added... lol) then you can comment on this and say you played the game and want to be a beta tester! Thank you!

[ Continue Reading.. ]

3 comments


Cart #zodojadabo-0 | 2024-11-29 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

4 comments


@toadofsky
I moved the conversation to chat so as not to clog up the cartridge section.

in response to your last post;
how are you going to hook up PICO-8 to the internet though? Can you do that?

2 comments


Cart #japi_jorth_1-5 | 2024-12-09 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
3

Jorth

A small stack-based language interpreter implemented in Pico-8, oh and a text editor too. It's a programming toy. If you know Forth, this language won't be too hard to learn.

Controls

Ctrl-G: Switches modes
Ctrl-D: Deletes the current code
Ctrl-C: Copies the code (bugged)
Ctrl-V: Pastes whatever is in the clipboard (bugged)
Ctrl-H: Replaces the current content of the program with a help menu
Click to run the code.

Changelog

0.1:

  • First version!

0.2:

  • Added Ctrl-H for docs
  • Added STOP intrinsic

0.3:

  • New intrinsics for working with Lua
  • New docs for IF-ELSE, DEF, and Lua intrinsics
  • Smarter error messages

[ Continue Reading.. ]

3
12 comments


Cart #picopyro-16 | 2024-12-22 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
6

-= PYRO : World Espionage =-

OVERVIEW

An in-progress game based on the old DOS game Pyro II (itself based on an older game named Firebug).

Infiltrate various sites to recover or destroy top secret files, then burn the evidence as you make your escape. How far can you go?

INSTRUCTIONS

Shortly after entering a floor, your Fuse will ignite - use it to burn as much as you can before making your way down the exit stairs.

  • Use Gas Canisters to spread gasoline, or leave them behind to cause explosions
  • Only some walls burn, others cannot be burnt, though they can be exploded
  • The staircase can only be entered from the right side, regardless whether the walls around it are burned down.

[ Continue Reading.. ]

6
10 comments


Cart #coincatching-0 | 2024-11-28 | Code ▽ | Embed ▽ | No License
2

2
1 comment


Hello,

I am simulating a ball being dragged around by a player. I'd like to create some animation to simulate that the ball is rotating (top-down view). I am trying to do that with a light source on top of the ball but I can't quite get it working correctly.

Looking for advice or some pointers to good tutorials on this subject.

Thanks in advance

function _init()
	player = {x=64, y=64}

end

function _update()
 local move_x, move_y = 0, 0
 if btn(0) then move_x = -1 end
 if btn(1) then move_x = 1 end
 if btn(2) then move_y = -1 end
 if btn(3) then move_y = 1 end

 -- update player position and animation
 if move_x != 0 or move_y != 0 then
     player.x += move_x
     player.y += move_y 
	end
	update_ball()

end

function _draw()
	cls()
	rectfill(player.x,
		player.y,
		player.x+8,
		player.y+8,
		8)
	draw_ball()

end

--ball

ball = {x=80, y=80, vx=0, vy=0, length=24, friction=0.9, mass=5, pull_force=0.2}

ball.hitbox = {2,2,6,6}
ball.name = "ball"
ball.radius = 5

-- in ball initialization
ball.light_pos = {x = ball.x, y = ball.y}

function distance(x1, y1, x2, y2)
    return sqrt((x2-x1)^2 + (y2-y1)^2)
end

function update_ball()
    local dx = ball.x - player.x
    local dy = ball.y - player.y 
    local dist = distance(ball.x, ball.y, player.x, player.y)

    if dist > ball.length then
        local angle = atan2(dx, dy)
        local pull_strength = (dist - ball.length) * ball.pull_force

        ball.vx -= cos(angle) * pull_strength
        ball.vy -= sin(angle) * pull_strength
    end
    ball.vx *= ball.friction
    ball.vy *= ball.friction
    ball.x += ball.vx
    ball.y += ball.vy

    if ball.vx != 0 or ball.vy != 0 then
        local move_dir_x = ball.vx > 0 and 1 or (ball.vx < 0 and -1 or 0)
        local move_dir_y = ball.vy > 0 and 1 or (ball.vy < 0 and -1 or 0)

        ball.light_pos.x += move_dir_x * 0.5
        ball.light_pos.y += move_dir_y * 0.5

        -- check if light has reached ball edge
        local light_dist = distance(ball.x, ball.y, ball.light_pos.x, ball.light_pos.y)

        if light_dist >= ball.radius+1 then
             -- move light along the direction of movement
             ball.rolled_under = true
            ball.roll_under_timer = ball.roll_under_frames

            -- reposition light on opposite side of ball and continue moving
            ball.light_pos.x = ball.x - move_dir_x * ball.radius
            ball.light_pos.y = ball.y - move_dir_y * ball.radius

            -- immediately continue moving in the same direction
            ball.light_pos.x += move_dir_x * 0.5
            ball.light_pos.y += move_dir_y * 0.5
        end

    end

end

function draw_ball()
    line(player.x+4, player.y+4, ball.x, ball.y, 13)
    circfill(ball.x, ball.y, 5, 1)

    -- light spot
    circfill(ball.light_pos.x, ball.light_pos.y, 1, 7)

end
4 comments


Cart #juicio-1 | 2024-11-26 | Code ▽ | Embed ▽ | No License
17

Welcome!

Juicio (Juice-e-Oh) is a local startup situated in the middle of No-where Dry Dry Basin.
Sasa needs help making smoothies for hungry bird clientele, Fit falling fruit into 5x5 squares to clear!
Zone out to either minty or spicy mode and share your highscores!

Controls

Left/Right to move (Fruit can wrap across the screen.)
Down to advance by one
Up to quick drop
🅾️ to advance/select dialog option

Notes

Star blocks give score when you fill the star birds on the sides of the screen. If you fill them out with stars to spare you'll get bonus score.
If fruit goes over the blender line it's game over, But if you would've cleared your all good to keep going!

[ Continue Reading.. ]

17
5 comments


Cart #joemetridesh-0 | 2024-11-28 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
2

this is a proof of concept :3

i basically took the concept of geometry dash platformer mode aand ported it to pico-8

all the original game art belongs to mr robert topala, all i did was use it as reference :)

(edit: forgor to mention that the spike hitboxes are very stupido dumdum but it's whatever)
(edit edit: i'm still learnin lua so i had chatgpt help me please don't kill me :3)

2
2 comments


(im an un-experienced pico-8 dev)

So i've been developing a small program that will allow you to draw things with different colors from the alternate color pallet, so far you can just switch colors from their alternate pallet and regular pallet.

But I realized that if I want, lets say the regular red and the alternate red at the same time, it wouldn't be possible.

So what i'm looking for, is an easy way to fix my mistakes and change my cart so that I can have alternate and regular versions at the same time, of one of the colors. (im aware that each time the alt and reg versions of a color is present, one of the other colors will need to be sacrificed)

Cart #colorpal-0 | 2024-11-27 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

0 comments


Cart #hamtuner1-0 | 2024-11-27 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
1

Working on my HAM license, I decided to procrastinate by trying to make a little game to help me remember certain frequencies / terms to work towards my licensing test!

1
0 comments


I repurposed one of my tweettweetcarts into this little 2 player game. The gameplay is finished I think but visually it feels like something is missing. I have plans to add a title screen and cover art. Any suggestions or constructive criticism would be appreciated! :

Chomp

Chomp 10 coins fast!

Controls:
P1: arrow keys or x, o or gamepad1
P2: ESDF or Lshift, A or gamepad2

Credits:
Music by snabisch
Sound effects by Gruber
Sprites by ivoryred, Kicked-in-Teeth, and Ironchest Games

This game is also on itch.io

Cart #evn_chomp_v1_0-0 | 2024-11-27 | Code ▽ | Embed ▽ | No License
1

1
1 comment


Bézier Demo

Cart #jewetopuwe-0 | 2024-11-26 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
3

A demo implementing a cubic Bézier curve in PICO-8. Nothing more to it!

I aimed to make a super simple demo focused on the absolute basics of this curve, so hopefully those unfamiliar will find it easier to understand how it works. The code is fully commented.

Requires mouse control. Click and drag the control points to manipulate the curve.

3
0 comments


So im trying to switch the alternate color pallet back and forth every second with this code.

function _draw()
 pal(8,128+8,flr(time()%2))
end

At first it has light red then waits a second and flips to the dark red, as expected, but then it just stays in the darker red and doesn't flip back for the second time..

All help greatly appreciated!

7 comments


Cart #kquest-0 | 2024-11-26 | Code ▽ | Embed ▽ | No License
11

a short, dumb adventure game made over the course of about 10 days for PiCoSteveMo 2

11
5 comments


Cart #marcianitos2-0 | 2024-11-19 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
3

Overview

Marcianitos tries to recreate the experience to play a shmup from an 80s arcade video game room, where you wasted a little amount of coins in an addictive game. Difficult to play, but worth it if you were willing to spend some time shooting enemies and looking for strategies to defeat the final boss. You wanted to play again and again because you knew you could do it better next time.

Controls

  • Arrow keys for moving the ship
  • Z normal shot
  • X bomb shot (high damage)

Rules

Kill all the enemies you can before they kill you!

[ Continue Reading.. ]

3
1 comment


Cart #hackrun1-0 | 2024-11-26 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

Use your sk1llz to breach the system, wrong choices cause glitches.

0 comments


Cart #motorcycle-0 | 2024-11-25 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
1

I like riding my motorcycle, but sometimes it's too cold, so I made this video game to relive the feeling.

1
1 comment




Top    Load More Posts ->