Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by disabling your ad blocker.

Animate a Compressed Sprite Atlas in a Phaser Game

You might recall that I recently wrote a tutorial titled Animate Spritesheets in a Phaser Game where I created two different sprite animations from a single spritesheet. The process was quite simple, but not very optimized. In this previous tutorial, the spritesheet had each frame being composed of the same resolution image. This allowed us to iterate over the frames kind of like an array. However, because each frame in the spritesheet was the same size, we had a lot of empty space padded between each of the frames. Wasted space in an image means we’re now working with a larger image in resolution and in file size.

We can improve upon this process with what’s known as a sprite atlas.

A sprite atlas is still a spritesheet. We have numerous frames in a single image file, the difference being that all of the padded white-space has been removed. Since the images are of different sizes and positions, we can no longer iterate over them like we did in the previous example because we don’t know where one frame ends and another begins. To know the information of each frame, we need an atlas which is like a map.

In this tutorial we’re going to see how to take a sprite atlas, composed of a compressed spritesheet and map information, and animate it within a Phaser 3.x game.

Read More

Creating a Multiplayer Drawing Game with Phaser and MongoDB

When it comes to MongoDB, an often overlooked industry that it works amazingly well in is gaming. It works great in gaming because of its performance, but more importantly its ability to store whatever complex data the game throws at it.

Let’s say you wanted to create a drawing game like Pictionary. I know what you’re thinking: why would I ever want to create a Pictionary game with MongoDB integration? Well, what if you wanted to be able to play with friends remotely? In this scenario, you could store your brushstrokes in MongoDB and load those brushstrokes on your friend’s device. These brushstrokes can be pretty much anything. They could be images, vector data, or something else entirely.

A drawing game is just one of many possible games that would pair well with MongoDB.

In this tutorial, we’re going to create a drawing game using Phaser. The data will be stored and synced with MongoDB and be visible on everyone else’s device whether that is desktop or mobile.

Read More

Animate Spritesheets in a Phaser Game

When it comes to 2D game development, sprite animations are going to be a critical part of the game experience. No one wants to play a game with a static unappealing image that moves around on the screen. They are going to want vibrant animations that add a certain realism to the game-play experience, even with it being 2D.

There are a few ways to accomplish animations in game development. You could develop complex logic that swaps images on a sprite every time the render function updates, or you could work from a single spritesheet and iterate over the frames in that spritesheet.

One of the main benefits to spritesheets, beyond them being easy to animate in modern game development frameworks, is they are easy on the computing resources. Loading one image file is less resource intensive than loading several image files, and when it comes to smooth performance in games, how you manage your resources can make or break your game.

In this tutorial, we’re going to see how to animate 2D sprites in a Phaser 3.x game using simple spritesheets with JavaScript.

Read More

Announcing, Blogging with WordPress for Beginners, an Online Course

I’m pleased to announce that the course, Blogging with WordPress for Beginners, has been released to The Polyglot Developer courses portal.

So what does this course attempt to accomplish?

If you’re interested in starting a blog to represent your brand and grow your audience, you’ll see how to do this using WordPress, a popular content management system (CMS), and a strong search engine optimization (SEO) strategy.

Read More

Create a Stream Deck Plugin to Interact with Webhooks

I recently jumped on the hype train when it comes to streaming and picked up an Elgato Stream Deck. If you’re unfamiliar, these devices are essentially hotkey peripherals with LCD adjustable keys that allow you to quickly perform certain tasks. Could a keyboard shortcut get the job done? For a lot of tasks, definitely, but the Stream Deck software is where the magic comes in.

The Stream Deck software allows you to connect certain services or multi-stage shortcuts to a specific key, something a standard keyboard shortcut probably won’t do well. In addition, you’re able to design your own actions using simple JavaScript and HTML.

In this tutorial, we’re going to see how to create a Stream Deck action, one that sends HTTP requests to remote webhook services, using JavaScript.

Read More

TPDP E38: COBOL Development on the Mainframe

If you’re interested in learning about COBOL, you’ll find a lot of value in, COBOL Development on the Mainframe, the latest episode of The Polyglot Developer Podcast.

There’s been a lot of buzz around COBOL in recent news, which is amazing considering how far the programming technology dates back. In this episode of the podcast, I’m joined by Elizabeth Joseph from IBM, and we discuss the things that COBOL does well, where it’s used the most, and why it’s making such a huge comeback.

You don’t have to be a system admin, mainframe developer, or COBOL expert to get a lot of value out of this episode.

Read More

Searching for Nearby Points of Interest with MongoDB and Mapbox

When it comes to location data, MongoDB’s ability to work with GeoJSON through geospatial queries is often under-appreciated. Being able to query for intersecting or nearby coordinates while maintaining performance is functionality a lot of organizations are looking for.

Take the example of maintaining a list of business locations or even a fleet of vehicles. Knowing where these locations are, relative to a particular position isn’t an easy task when doing it manually.

In this tutorial we’re going to explore the $near operator within a MongoDB Realm application to find stored points of interest within a particular proximity to a position. These points of interest will be rendered on a map using the Mapbox service.

Read More