Log In  

Game jam submission for Shenanijam (sticky justice) and Pizza Jam (memory). Made in Pico-8 in 36 hours. Submission page: https://tarngerine.itch.io/justice-pizza

Cart #53440 | 2018-06-10 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
4

You're a pizza who works for a delivery place. Remember customer's orders and collect the ingredients in the correct order!

  • Press Z to shoot cheese to capture ingredients, then touch them to collect.
  • Hold Z to reset a stage.

Was fun to bust this out much quicker than I have for my previous two jams, but I still hate rewriting collision detection/basic physics every project. Also had a hard time being inspired for music this time.

Video: http://youtube.com/watch?v=JaviXdciNbE

P#53441 2018-06-10 07:28 ( Edited 2018-06-11 11:09)

im doing this flag waving animation, and ive gotten it to work via pset but it drops to 15fps while animating. if i reduce the height of the flag to a certain point, it'll rise back to 30fps. any tips here on what i could do to improve?

note: i dont understand a lot of the memory/buffer methods that i've seen mentioned elsewhere, should i be looking at that? any examples?

P#53442 2018-06-10 07:28 ( Edited 2018-06-10 11:28)

You could optimize some of the flag by using vertical stripes with rectfill(), but even with pset(), you can run a lot faster by extracting a bunch of loop invariants.

I've rewritten this section of your code:

    local c = 0
    for y=0,48 do
      for x=0,127 do 
        c =
          (y==0 or y==48) and 7 or
          (y==16) and 7 or
          (y>16 and y<48) and 3
          or 8
        if (not level.started and level.inittime>((x+y)/8+cos(y/4))) or
          (level.started and (level.inittime-level.starttime)<((x+y)/8+cos(y/4))) then
          pset(x,y+38+(sin((time()/2)+x/100)*1.1),c)
        end
      end
    end

Into this, with comments to explain the basic ideas:

    -- compute the vertical 
    -- flag colors *once*
    -- (could go elsewhere)
    local p = {}
    for y=0,48 do
      p[y] = (y==0 or y==48 or y==16) and 7
        or y>16 and 3
        or 8
    end

    -- extract x,y-loop invariants
    -- and choose two functions so
    -- we will wipe-on or wipe-off
    local t2 = time()/2
    local l = level.inittime
    local lt_pset = function() end  -- nop
    local gt_pset = pset
    if level.started then
      l -= level.starttime
      lt_pset,gt_pset = gt_pset,lt_pset  -- swap draw/not-draw sides
    end

    -- use pico-8 "hardware"
    -- to effectively add 38 to
    -- all submitted y values
    camera(0,-38)

      for x=0,127 do

        -- y-loop invariant
        local s = sin(t2+x/100)*1.1

        -- render a wipe-on or
        -- wipe-off depending on
        -- which way we set the
        -- two pset functions.
        for y=0,48 do
          if l<((x+y)/8+cos(y/4)) then
            lt_pset(x,y+s,p[y])
          else
            gt_pset(x,y+s,p[y])
          end
        end
      end

    -- reset camera offset
    camera()

This easily runs 30, and at least in my little test, ran 60 for me.

As an aside, it's not as expanded as it appears with all of those explanatory comments. This is the brief version:

    local p = {}
    for y=0,48 do
      p[y] = (y==0 or y==48 or y==16) and 7
        or y>16 and 3
        or 8
    end

    local t2 = time()/2
    local l = level.inittime
    local lt_pset = function() end
    local gt_pset = pset
    if level.started then
      l -= level.starttime
      lt_pset,gt_pset = gt_pset,lt_pset
    end

    camera(0,-38)
      for x=0,127 do
        local s = sin(t2+x/100)*1.1
        for y=0,48 do
          if l<((x+y)/8+cos(y/4)) then
            lt_pset(x,y+s,p[y])
          else
            gt_pset(x,y+s,p[y])
          end
        end
      end
    camera()
P#53446 2018-06-10 08:40 ( Edited 2018-06-11 17:34)

i know this was just a time-constrained jam game, but please please please can you make one of the two O/X buttons be jump? Up as jump is infeasible on a gamepad, which is the target fantasy input device for PICO-8, and also what the mobile web interface is. (lots of people forget to think about gamepads, but as a helpful guide when designing controls, remember: keyboard arrow buttons are controlled using multiple fingers, which is fundamentally different from a single thumb on a d-pad or joystick)

anyway I love pizza and pizza games and I applaud you for making this :) 👏🍕

P#53459 2018-06-10 13:58 ( Edited 2018-06-10 17:59)

Agree with kittenm4ster.

I actually often watch a YouTube channel called UpIsNotJump and part of the reason is that I saw the name in the YT sidebar and simply had to know what such a sensible person had to say. ;)

P#53470 2018-06-11 07:09 ( Edited 2018-06-11 11:09)

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-04-18 01:06:35 | 0.010s | Q:21