Getting started with javaScript

I have written many posts on javaScript related topics, but so far oddly enough I have not written a getting started post on javaScript until now of course.

In this post I will offer some suggestions for getting started with javaScript that you can do right now from your desktop computer. One of these ways of getting started with javaScript will work out great even without installing any additional software assuming you have at least a web browser, and a text editor installed. In fact in some cases you just need a browser to get started when it comes to starting out in the javaScript console, or going to a web site like js fiddle that I was using for a while as a way to draft out an idea. Both the javaScript console and websites like js fiddle are great starting points when it comes to working out some simple expressions, and very basic programs sooner or later you might want to explore one of the many other options that is another way of getting started with javaScript though.

So then when it comes to really getting into javaScript development at some point sooner of later you might want to have some kind of JavaScript run time environment installed such as nodejs. Even if it is your intention to do just client side javaScrit development it is still often required to do at least a little back end programing now and then. For example when I was first starting out with javaScript I was hand coding html files and then opening them up in the web browser by way of the file protocol. This will work fine for most situations, but there are certain client side javaScript features that will case Errors when the project is opened up in the browser as a local file. So one way to solve that is to always host what I am working on by way of the http protocol rather than the file protocol and to do that I am going to need at least a little back end code to set up a basic web sever.

There is all kinds of additional software that one might want to have on there computer at one point or another also such as some kind of source control program such as git. There are all kinds of additional programs that come to mind such and an image editor of one kind or another and so forth. However one great thing about getting started with javaScrit is that just about all of this is optional when it comes to making those first steps. When starting from zero experience, if you have a computer with a web browser, you can get started, and worry about all this other stuff I have mentioned later.

Read More

Sprites in phaser ce, what to know.

When it comes to making an html 5 game with javaScript and phaser ce as a front end game framework, Sprites are central to just about any kind of game project. There is a lot to cover with sprites when it comes to creating Sprite sheets, hit detection, motion and physics, handing groups of sprites, among many other topics as well. So I can not possible cover everything there is to write about when it comes to sprites, but I can at least cover the basics, as well as link to other posts on my site that might help cover most of what there is to know about sprites in phaser ce.

Read More

WebGL Renderer core features and more in threejs

There are a few core components to making a threejs project, there needs to be a scene object, a camera to set the point in space by which to look at something in the scene object, and one final other component that is needed on top of all of this and that is a renderer. There is also having something to look at added to the scene object as well such as a mesh object that is composed of a buffer geometry, and a material. However there are other options when it comes to adding content to a scene object, so the core set of objects are really just those three things. That is a scene object, camera, and renderer.

In older versions of threejs there was both a 2D canvas renderer, and webgl renderer, but in later versions it has been removed from the core of threejs itself. So now when making a threejs project I am pretty much always working with the WebGL renderer as that would seem to be the best option for most typical use cases of threejs. There are some additional options built into the core of the threejs library, and additional renderer options that can be added by way of additional javaScript files. However in this post I will be writing a thing or two about the WebGL renderer. I will not get into every little detail but I will be writing about every core feature that I think is important to be aware of with this.

Read More

Generating a texture with graphics to use with sprites in phaser ce

So I have wrote a post on how to make sprite sheets with canvas, which seems to work okay as a way to generate graphics to use in a phaser ce game project without loading an external image. However in this post I will be writing about how to go about doing so with phaser graphics display objects. Also for whatever the reason it might be nice to just generate textures in generate for whatever the reason using phaser graphics, so in this post I will be writing about some use examples of the generateTexture method of the Phaser Graphics class.

Read More

Using flow as a way to chain methods with lodash, and javaScript

In lodash there are a few options when it comes to making use of more than one lodash method in a chain or sorts one of which is the _.flow method. The lodash flow method works by calling the method and passing an array of functions that will be called on after another in order from the lowest index to the highest. For each call of each function the return value of the last function will be used for the argument value for the next and so forth.

There are other options to be aware of that can be deployed to use two or more lodash methods in order though such as calling the main lodash top level function, or using the lodash chain method.

There are many ways to go about chaining methods together with just plain old javaScript by itself as well though, so I will be writing about vanilla js examples as well in this post.

Read More