DEV Community

Cover image for Staring in awe at Pulp Pong
Robert Mion
Robert Mion

Posted on

Staring in awe at Pulp Pong

The fourth tutorial in the list of links is a blog post describing one developer's successful attempt at re-creating Pong using Pulp.

I didn't get very far on my own

  • I re-created the single room
  • I placed text for both players' scores in the room

Inspecting the JSON file in pulp

Thankfully, the author made PDX and JSON files available for download.

I snagged the JSON file and loaded it in a new pulp game.

Layers and tiles

  • World tiles to make the card screen
  • One item tile for the score divider
  • Sprites for player 2 and the ball
  • Player tiles for the paddle body, top and bottom
  • No Exits

Sounds

  • A one-note sound for when the ball collides with a wall or paddle
  • A four-note sound for when either player scores

Scripts

  • These files are intimidating, but accessible
  • The author has written some very helpful comments
  • A lot of it is understandable
  • The tough part is following all the custom functions

In awe

  • I admire the author's ability to simulate smooth animations for the ball and player paddles
  • I'm impressed by all the edge-case handling, especially when the ball tile overlaps a paddle tile
  • Oh, and switching between a CPU player 2 and human player 2 based on whether the crank is docked or not

The complexity of managing tiles

  • Designing a playdate game in pulp seemed simple at first
  • This game's scripts are proof that the tough part is in swapping tiles and accounting for the correct tile being in the right place at all times
  • So, the good news is the code will likely often require conditionals to check tile types at target location
  • The bad news is the complicated mess of nested conditionals that could amass in even a simple game like this

I think it's time

  • I gotta make something from scratch
  • I gotta practice writing PulpScript
  • I gotta think of some simple game

Good luck, self. Remember, it's supposed to be fun!

Oldest comments (0)