Skip to main content

Posts

Showing posts from January, 2019

World In Motion

In the last post I touched on how easy it is to score in this game - you can just camp out on the score bullet spawner and watch the points rack up. I'm going to add a little delay to the score bullets so that they start out in a deactivated and uncollectable state, and then change to active and collectable after a short time - say, half a second. To make it clear what state they are in I'm going to add code to let me change the look of Objects and allow them to be animated.

Born Slippy

Up until now, the player control has felt very "digital" and harsh. Whilst there's an argument to be made that that is how it should be in a shoot-em-up, I didn't like it that much. I'm going to add a little bit of momentum to the player sprite to give the ship a feeling of weight.

Loaded

The images in the game are being loaded by creating an Image element and using a .png file, stored as a Base 64 encoded string, to load the data: Every time I need to change a sprite in the game the process is: Edit the source .png image file in a paint program and save it Convert the file to a Base 64 encoded string (I use https://www.base64-image.de/ for this) Copy the encoded string Paste it into the source code Refresh the game in the browser This works ok when there are only a few graphics, but it doesn't scale very well. The workflow that I really want is: Edit the source .png image file in a paint program and save it Refresh the game in the browser Much better! So how do I do that? I'm going to add a resource manager that loads the .png files directly from the server.

Phony Game

Up until now I've been mostly focusing on the game technology and neglecting the game play . I'm going to address that a little bit by adding scoring to the game. I want to add some risk/reward to the gamplay - score higher by taking more risks. From now on I'm going to try to make sure that I remember to add gameplay features as well as tech features. So how do you score in a shoot-em-up where you can't actually shoot? There are a few possible ways that come to mind: Score bullets: Fired from spawners like normal bullets, but instead of hurting you when you collide with them they give you score Bullet grazing: Score points by flying very close to bullets  but not close enough to be killed Score zones: Marked areas of the screen that award you points when you fly over them I like all three of these scoring methods and I'll probably implement them all over time. If you have any more good scoring ideas that you'd like to see in the game, please let me know

Constant Craving

In this post I'm going to do some housekeeping on the game and add four small things that each make the development process a little bit nicer: A constants file to keep all the configuration magic numbers in one place A script to serve the game files up to your browser from your machine, so you can build and test the game locally and very quickly A better way to see the debug console output without having to open up the browser debug console A favicon to stop the browser complaining that it can't find one