DEV Community

Cover image for Find the poops! My first Playdate game made in Pulp
Robert Mion
Robert Mion

Posted on

Find the poops! My first Playdate game made in Pulp

My journey

  1. Considering my audience
  2. Recognizing my skill range
  3. Preparing the room and tiles
  4. Placing the four player-adjacent tiles
  5. Placing the poop tile at a random location
  6. Revealing poop when it is one tile away
  7. Resetting the adjacent tiles
  8. Adding a hint
  9. Why won't this end?
  10. Embracing the bug
  11. Making the title card
  12. Outstanding bugs
  13. Published on itch.io
  14. Celebrating my accomplishments

Considering my audience

  • My son: a 3.5 year old boy
  • Who loves talking about poop, toots and other gross bodily activities
  • And who enjoys fiddling around with my Nintendo Switch and iPhone

Recognizing my skill range

  • I can swap tiles
  • I can respond to player movement events
  • I can generate random numbers
  • I can place text on the screen
  • I can generate messages
  • I can identify adjacent tiles

I can do this!

Preparing the room and tiles

  • Make the room all black
  • Switch the color of the player
  • Make the player's background pixels transparent
  • Create a poop tile
  • Create a poop-in-the-dark tile

Placing the four player-adjacent tiles

First, generating the X and Y coordinates:

px = event.px
py = event.py
above = py
above -= 1
below = py
below += 1
right = px
right += 1
left = px
left -= 1
Enter fullscreen mode Exit fullscreen mode

Placing the poop tile at a random location

Generating the coordinates:

poopX = random 0,24
poopY = random 0,14
Enter fullscreen mode Exit fullscreen mode

Briefly revealing the location:

tell poopX,poopY to
  swap "poophidden"
end
wait 1 then
  tell poopX,poopY to
    swap "black"
  end
end
Enter fullscreen mode Exit fullscreen mode

Revealing poop when it is one tile away

This is part pseudo-code, since each of the four conditionals is very similar:

if [within the room's bounds] then
  tell X,Y to
    if X==poopX then
      if Y==poopY then
    swap "poop"
      end
    end
  end
end
Enter fullscreen mode Exit fullscreen mode

Resetting the adjacent tiles

In player, a custom reset event is emitted on each update event.

The reset event is attached to both poop tiles.

It simply swaps the tile for black.

Adding a hint

While play-testing, I would miss or forget where the poop is.

So, I made the A button briefly show the poop again:

on confirm do
  tell poopX,poopY to
    swap "poophidden"
  end
  wait 1 then
    tell poopX,poopY to
      swap "black"
    end
  end
end
Enter fullscreen mode Exit fullscreen mode

End after collecting one or more poops

I added an on collect do event to the poop tile.

Inside it, I called fin with a game-ending message.

Why won't this end?

I play tested in the pulp browser simulator.

Everything worked as expected.

The game-ending message appeared after collecting the poops.

I downloaded the PDX file.

I opened it in the Playdate Simulator.

I collected the poop.

The console spit out a cryptic error.

I spent an hour attempting to address the error.

I couldn't figure out why the game crashed when it attempted to end.

Embracing the bug

I decided the game just wouldn't end.

Instead, the player just collects poop that appears in different locations.

Here is my updated poop tile collect function:

on collect do
  poops++
  say "You found {poops} poops!" then
    tell event.game to
      call "movePoop"
    end
  end
end
Enter fullscreen mode Exit fullscreen mode

movePoop is the code you've now seen several times, with a new poopX and poopY generated prior.

Making the title card

I exported the font and imported it for use as World tiles.

I created a few rounded-corner tiles to make the poop look...cooler?

I duplicated and inverted the three letters, 'THE', to appear inside the poop.

Title card for my game

Outstanding bugs

  • The game doesn't end
  • If the poop newly appears really close to the player, it won't properly swap the poop and poop hidden tiles immediately
  • If the poop appears in the same position as the overlaid text, it is invisible but still collectable

Published on itch.io

  • I registered
  • I made a game page with description, cover image and links to download
  • I published that page

Celebrating my accomplishments

  • I built a game almost entirely from scratch in pulp!
  • I debugged an issue where the player couldn't move to the top or bottom rows. And got stuck in place!
  • I worked around a game-non-ending bug!
  • I published it on itch.io!

I showed my son the game.

Sadly, it didn't hold his attention for more than 10 seconds.

Oh well. It was still a great learning experience making it!

Latest comments (0)