Wednesday, April 27, 2016

The Most Awesome Thing on the Internet

Here it is, people. The most awesome thing on the Internet (besides my frog comics) - a
Mariachi Cover of the Dark World theme from The Legend of Zelda: A Link to the Past.




You can thank me later (by viewing and sharing today's comic!). Oh look, here it is...

Amphibian.com comic for 27 April 2016

Monday, April 25, 2016

Review of Xgaming's NES-style Wireless Gamepad

Late last week I received my new Bluetooth wireless gamepad from Xgaming. I was really excited about this new product. I've had one of their arcade joysticks for years and found it to be an excellent piece of hardware that fully lives up to the high expectations set for it on their web site. I was certain that this new wireless gamepad, a bit of a departure from their existing product line, would not disappoint me.


So, what do I think now that I've had a few days to play with it?

Let's start with my initial impressions. It was a little smaller than I had expected it to be. It doesn't really give dimensions anywhere on Xgaming's site (as far as I could tell) but the unit is only 5.125 inches wide and 2.5 inches tall. It's slightly over half an inch thick (not counting the sticks and buttons). For me, the small size makes hitting both sets of top trigger buttons awkward but maybe I just need to get used to it. Most games I play only need one set of top triggers anyway. Besides that, the position of all the buttons and sticks is excellent. It weighs only 3 ounces, but feels very solid. The buttons and D-pad are very firm and have a wonderful feel to them.

Technically, it has been functioning very well. I had no problems pairing it to my Windows 10 PC as a Bluetooth game controller, but it did seem to lose its pairing once (there are colored LED lights on the bottom which indicate things like that - flashing blue means ready to pair). I'm not sure if it was the device's fault or mine - I may have been holding down one of the settings buttons inadvertently while powering it on. I'll withhold judgement on that issue until I see if it repeats. There were no issues setting up button mappings in my emulator software either. It all worked very well.

Playing games with it has been very enjoyable so far. The button response is much better than my old SNES-style USB game controller. I honestly haven't liked a PC game controller this much since my Gavis PC GamePad.

The device is currently selling for about $45. If you love playing emulated NES and SNES games as much as I do, I believe you'll find it to be well-worth the money.

The only question left might be, does it work in web-based HTML5 games such as the 8-bit style platformer I've been working on? The answer is...maybe. Web browser gamepad support is still weird. Phaser has an API for it, but so far I've found it difficult to work with. I'll keep trying and maybe have something to report next week.

Until then, I've got more comics for you to enjoy!

Amphibian.com comic for 25 April 2015

Friday, April 22, 2016

Answering Questions

Tonight I'm working on answering interview questions. Yes, I'm being interviewed by Best WebComics, a site that promotes the discovery of new webcomics. Their questions are rather unique so the finished interview should be a good read. I also get Amphibian.com promoted on their site for a week next month.

I've been working on the comics for over 2 years now. The first comic was published in August of 2014 but I actually started working on it in January of that year. It took almost 8 months to get things ready. I had to develop the web page stuff, the back-end application that runs everything, make the editor for the comics, and write a bunch of comics. Looking back on some of my early work, I think I've gotten a lot better.

So when you view today's comic, why don't you click the link to go back to the first comic too? Even if you've been reading them from the beginning, you've probably forgotten the early ones.

Amphibian.com comic for 22 April 2016

Wednesday, April 20, 2016

Read Another Blog Today

As I said last week, I'm not spending as much time writing this blog as I normally have been. I need a few weeks off from it due to the demands of the real world. But that doesn't mean that you, the reader, have to suffer. Please take the time you would have normally spent reading my inane ramblings to read someone else's.

Here are some excellent options:

Smoke in the Cinderhaze
I'm not exactly sure what a "Cinderhaze" is, but I suspect that it's a word used to describe Cinderella's mental state before she has her first cup of coffee in the morning. Either that or some kind of sailor thing. This tech blog is written by my friend Daryl Wiest, and he doesn't update it often enough. Go leave him some comments about that.
David Walsh Blog
An excellent tech blog that covers a variety of topics, but often covers JavaScript and front-end stuff. Also some excellent career advice sometimes. This David Walsh guy is fairly famous so you might have heard of him already. If not, you should.

While you wander off to read those, don't forget to read today's comic! It's #314, which is a lower number than Monday's comic (#315). That kind of thing hasn't happened in a while. I move the publish dates around from time to time after I make them. I hope it doesn't bother anyone.

Amphibian.com comic for 20 April 2016

Monday, April 18, 2016

Better Static Images for Amphibian.com

The new, improved version of the image for a recent comic.
As I mentioned last week, I have been working to close Issue #7 on my webcomic. Basically, Amphibian.com is not a normal webcomic. It's not an image, which is great until someone wants to share a link to a comic on social media. I auto-generate static images of the comic just for sharing. But the comics which contain embedded games and stuff haven't looked right in the static captures. I wanted to at least put a warning in the image that explains why they often look weird, but as an added bonus I actually made them look better (most of the time).

As you can see in the picture on the right, I was able to add some warning text to the top of dynamic comics. I generally share this version on TopWebcomics.com but you may see it other places as well. When people see comics like this in the future, they'll know that they should view it on Amphibian.com to get the full effect.

Also, when this comic was originally published, the third frame was black. The game was not captured as part of the image. This was due to two things - the URL of the page used for the image capture was such that the game's image assets could not be loaded, and the fact that the capture was taken before the game initialized asynchronously. I fixed the URL issue by changing the static image comic path from /basic/[comic-number] to /[comic-number]&b=1. There wasn't really a generic way to ensure the comic will be rendered before the capture in all cases, but I added a 500 millisecond delay which should be good enough the majority of the time.

Finally, I also locked-down the ability to see the basic versions of the comic. It was the case that you could view a future comic if you asked for the basic rendering. I changed the rules so that only authenticated users or requests coming from the server itself can see them. I use PhantomJS to perform the image capture and it runs on the server, so that was a simpler fix than I initially thought that it would be.

It always feels good to resolve an issue. It also feels good to read one of my comics. Here's the link so you can feel good too.

Amphibian.com comic for 18 April 2016

Friday, April 15, 2016

Basic Images are Complicated

I sat down tonight thinking that I would quickly resolve Comic Issue #7, which has to do with the static images generated for sharing on social media platforms. Here it is almost midnight and I am not finished.

It's been bothering me that many of the dynamic comics (the ones that use JavaScript for a game or something) are not rendering correctly at all as static images. See this post on how I generate the static images. I finally figured out that it is because I take pictures of "basic" versions of the comics (no header, footer, etc.) and I generated the "basic" versions of the comics at a slightly different URL. When the page rendered there, sometimes file paths used in embedded JavaScript would be wrong and lead to missing resources which in turn leads to a bad picture.

Another problem with this method was that I render the images before the comic's official release date and so I had to leave the basic URL open - that is, no authentication was required to see future comics if you requested them in basic form. I doubt that many people took advantage of this flaw, but still...

Of course I wanted to fix all these problems in addition to just marking dynamic comics as dynamic in the basic view. So I'm not finished with any of it. I'm like, 85% finished. But tomorrow is another day. A day in which I might write another post about what I actually did to fix the problems! Until then, entertain yourself with today's comic. It's funny, and that's no accident.

Amphibian.com comic for 15 April 2016

Wednesday, April 13, 2016

Use Tiled's Map Background Color in Phaser

I actually did some work on my Phaser platformer this week! Yeah! I resolved an issue that was submitted on GitHub concerning the water physics in Level 7, and I started thinking some more about another thing which had been bothering me.

Even though I can set a map's background color in the Tiled map editor, Phaser doesn't parse that property when it builds a Tilemap object. I had been keeping track of the background colors for each level separately, but that violates one of my principles - the map editor should be the one and only source of data about each level map.

The Background Color map property in Tiled

I was able to make a few minor changes to work around this limitation. In the stage's create function, I first pull the tilemap data manually for the map's key. This is the same data that is used behind-the-scenes when you call game.add.tilemap(key).

function create() {

    // get the asset key for this level
    mapKey = "key-for-this-level";

    // pull the tilemap data from the asset cache
    var tilemapData = game.cache.getTilemapData(mapKey);

    // all the data from Tiled is in the data field
    var mapData = tilemapData.data;

    // set the stage's background color from the map's background color.
    // note that Tiled didn't capitalize the "c"...
    game.stage.backgroundColor = mapData.backgroundcolor;

    // go about making the make the normal way
    var map = game.add.tilemap(mapKey);
    map.addTilesetImage("ground", "tiles");

    // ... the rest of the stuff ...

}

The tilemap data object returned from the asset cache has itself a data field, which is essentially the Tiled JSON map object. The backgroundcolor property is there can can be used to set the backgroundColor property for the stage. Remember, you can view the full source code to this game in its public repo on GitHub!

It really was that simple. In only a few minutes, I feel like I accomplished something on this game for the first time in a month! It doesn't take much to make me feel good about my achievements. Now, go read today's comic and feel good about that achievement!

Amphibian.com comic for 13 April 2016