Linux Build Bash Script JavaScript Style

I have started toying around with bash scripts a little in place of just using nodejs as a way to automate work. I would normally use nodejs and a little javaScript as a way to create scripts that will do so, the great thing about that is that when I make the scripts a certain way they will work on any system in which I can install nodejs on. However these days I find myself preferring to just work in a straight Linux environment, as such I can make use of bash, and all the little various Linux commands there are to play with, in order to make quick work of things that I would otherwise have to do manually.

In my recent canvas example projects I worked out a basic bash script that has to do with automating the process of creating a package from javaScript source code files. The source code files are in development form, but I want them to all be combined together, and minified between some starting and ending html code to create a single final html file for the state of the canvas example. The bash script I worked out make use of shell level variables, and various Linux commands such as cat along with a single javaScript min script to create the final result that I want.

Read More

Mr Sun Geo.js and additional plug-ins

Today I started yet another canvas example based off the Mr Sun source code that I started recently. This time I started out with the source code, and plug-ins that I worked out for my Mr Sun Temp example. So when Mr Sun Geo as I have come to call it thus far is yet even more on top of that example.

In the previous fork Mr Sun Temp I made just a few minor improvements to the source code itself, and the real additions where in the form of a few plug-ins. The main focus there was the temp.js plug-in for this project that just contained the logic that sets temperature for the sun object, and all the world section objects. In this fork I am focusing on creating additional plug-ins that will have to do with the Geology, the Hydrosphere, and Atmosphere of the Game World in what I am just calling Mr Sun. All of these plug-ins depend on the previous plug-ins worked out in Mr Sun Temp, when it comes to temp.js and also fusion.js.

So then Mr Sun Geo is just the next step forward when it comes to working out game logic that will create a cool little simulated world.

Read More

Mr sun Temp and Fusion plug-ins canvas example

I am going to try something new when it comes to todays canvas example post, I am not going to just start a whole new example from the ground up. Often I do borrow a little code here and there from other examples, and projects when and where doing so is called for. However today I am going to just copy the whole source code of my Mr sun example at version 0.1.0 and start from there by just adding a few plug-ins to it, and making any changes that are needed to the source in the process if any.

So this way I am not starting over from the beginning, but if I need to I can make some changes that will not effect the other project. I can however add them to it later on if I feel as though such changes should be added.

Anyway this canvas example will then be a continuation of sorts on my Mr Sun game that I think might have some potential if I put a bit more time into it. In the game the player controls the position of a Sun object that effects the other word section objects that are centered around the sun object. In this post I am using the same core source code more or less, but I am adding two plug-ins to it that have to do with setting an updating a temp property for each section. In addition I am also starting another plug-in that has to do with fusion in the game, which I think would be another cool feature.

Read More

Mr sun canvas example

I want a canvas example that will be a simple god game, or a kind of game where things move forward on there own, and there is just a little interaction from the player now and then. I have come to like to play, and make these kinds of games these days. Playing a game can end up eating up a lot of time, so I like games that just move along on there own, and I can just step in and make a few changes now and then. Games like sim city, and roller coaster tycoon come to mind when it comes to this.

Anyway the canvas example that I had in mind here is a game where there is this world where there is a sun at the center of a circle, and the rest of the world is along the circumference of this circle. By default the sun starts at the center of this circle world, but the player can move it to any location within this world. The circumference of the outer circle of this world is divided into sections, and each section object has a percentage value, and this percentage value is effected by the distance of the section to the sun object.

There is a lot that comes to mind when it comes to moving forward with this kind of project. but one must start somewhere right? So with that said lets take a look at what I have so far with this one.

Read More

The lodash _.rearg method and rearranging function arguments

I have got into the habit of starting each month with one new lodash post while the library is still on my radar. I can not say that I find myself actually using lodash that much and more, when I do it is often just one or two methods that I bother with in the framework.

Todays lodash post is on the _.rearg method that can be used to create a new function with a function only rearranging the arguments for the function. I can not say that this is the most compelling function in lodash to support a case to install the full library these days. This kind of situation does not happen often for me, and it is really not that hard to create my own abstraction for this with just plain old vanilla javaScript itself when I need to do something like this in a project. So with that said this post will not just be on the lodash _.rearg method but also some vanilla javaScript alternatives that do more or less the same thing.

Read More