Frogatto & Friends

Frogatto sprite

Frogatto & Friends is an action-adventure platformer game, starring a certain quixotic frog.
We're an open-source community project, and welcome contributions!
We also have a very flexible editor and engine you can use to make your own creations.

Locking Doors

April 14th, 2011 by DDR

A quick post about some of the internals of the game that people don’t generally see, but which you’ll care about if you’re interested in making levels for frogatto (which, by the way, we’d love if you did, hint, hint. It’d be awesome if people would make levels and post them to the forums).

You will be able to lock doors without having to edit the level in a text editor, in the next release. Right now, you have to write a dense paragraph of code every time you need to lock another door, which is very annoying. In fact, right now it’s actually impossible unless you’re a programmer, able to code in our FFL language.

Lock on Door beside Key

We’ve wanted to fix this for a long time, but we were reluctant to, because few of our solutions seemed easy enough for non-techies. One of our ideas was to have a separate kind of door, just for locked situations, that would replace itself with the regular kind, if you’d unlocked it. Other ideas had you manually entering the id of a related door to make sure it would be locked, which … ick.

It occurred to me, recently that there’s always one correlation: doors are always pretty far apart, and locks are always put on top of them. If a person editing a level places a lock on top of a door, they probably intend to lock that door. We can check if they’re overlapping, in the code. Locks, also, are always unlocked by the corresponding colored key (something we previously had to hard-code). Since we can rely on these assumptions, we’re able to generalize this; locks now automatically lock a door if you (visually) put them on top of one. (This breaks down if you do something ugly, like making two doors overlap, but because that’s ugly, we don’t have to support it.)

So now, a task that used to require cracking open a level, and editing some scary, byzantine-looking code, is something you can do in the editor.

p.s.: This post 1/2 written by Jetrel, too. Thanks, man!


One response to “Locking Doors”

  1. PypeBros says:

    Will you link those technical posts together with a tag or a category ?