Payton.Codes

Musings on life, games, and code

Tag: javascript

  • Using Tiled editor for The Lost Card

    Using Tiled editor for The Lost Card

    It’s still amazing to me that I managed to finish an actual game for the first time. A lot of my success with The Lost Card I owe to the Tiled editor. I wanted to write a little blog post to explain all the ways in which I was able to leverage it to make…

  • Enemy State Machines in Lost Card

    Enemy State Machines in Lost Card

    This summer I made a simple game called The Lost Card using TypeScript and the Phaser framework. I wanted to write a little about some of the things I learned during that process. This post is about enemy behavior. Once I had a character I could move around my world, I needed to have enemies…

  • The Lost Card

    The Lost Card

    I was first inspired to become a software developer when I was very young when I got an original NES. Playing those early games gave me a passion to learn programming that was the foundation of everything I’ve done since. Back in the early days when I was just studying BASIC and Hypercard, I made…

  • Good coding practices

    Good coding practices

    I recently had to give a talk on “Good coding practices” for some new developers at Automattic. At first I had no idea how to summarize such a vast and dynamic topic, but as I was working on a plan I started to see some ideas come up over and over again and I decided…

  • grepdef: a quick way to search for definitions in code

    grepdef: a quick way to search for definitions in code

    I live inside my code editor all day and something that I need to do pretty often is to search for the definition of a symbol (a variable, constant, or function). For example, I might be debugging a problem in a JavaScript file when I come across this code: I need to see translateDataFromRaw to…

  • What I learned writing a game engine

    What I learned writing a game engine

    One of the things I did on my recent sabbatical was to start coding a video game in JavaScript. I learned a lot in the process, and I thought I’d write down some of my experiences. (For the record, while I wrote the game engine myself, I used the excellent Pixi library for graphics.) Classes…

  • Await, there’s more!

    Await, there’s more!

    This week I gave a talk at my local JavaScript meetup on the history, use, and future of Promises and I thought that you, dear reader, might be interested as well. Here’s the blurb: JavaScript is an asynchronous language; it is designed to react to events and to trigger jobs that take an unknown amount…

  • Alternatives to Else

    Alternatives to Else

    One of the first imperative programming concepts I ever learned was if/else. With this relatively simple power tool I could make decisions in my code based on any number of factors. Of course, my early programs were… a little hard to read. I hadn’t yet learned one of the maxims of programming that I try…