• About
  • Gallery of Images
  • Archives
  • Categories
  •   LowRezJam – Report 2

    4/05/14 - 15:34

     

    LowRezJam Animated

    Some real progress in the past 24 hours or so :)  Harvesters are now spawned in by pressing the ‘Z’ key – this is temporary for now, as I want to get a ‘build unit’ screen into the game.   This will spawn a harvester in the center of the viewport.  Harvesters also harvest now :) The harvesters have two stats associated with them, a tank ( which contains the harvested substance ) and health.  These are show on mouse over by two bars, the top horizontal bar showing how full the tank is, and the vertical bar showing the health of the harvester.  Once the harvester tank is full, it will stop collecting resources.  Currently there is no way for the harvester to lose health, but that is on the cards in the next few days.

    The health and tank bars were pretty awkward to do.  Initially I was going to use standard HTML5 line drawing code :

    ig.system.context.beginPath();
    ig.system.context.lineWidth = ig.system.scale;
    ig.system.context.moveTo(x1,y1 - ( ig.system.scale *2));
    ig.system.context.stroke();

    ( impact.js uses ig.system.context for canvas context ).  Alas, the drawback to this was the line it drew was anti-aliased, which is a big no-no when it comes to LowRezJam.  So I spent an hour or so playing around with ig.system.context.getImageData(); and ig.system.context.putImageData(); which ended up being a much better way of doing it, I could paint the pixels easily on the canvas to draw the bars.  I was drawing on the up-scaled image, so I had to create an array of pixel safe values, so that when the bars are filling up, they keep with in the real image pixel boundaries.

    I’ve also changed the way the map is generated now, and tweaked a couple of things, to change the size of the map ( it is now huge ) :

    Full landscape

    This takes the old 200×200 map, and now creates something 2000×2000 wide – the above screen shot is not even the entire world (click to enlarge) :)  Stupidly big for a 32×32 viewport – but fun I think :)  The tiny blue dot in the corner is a harvester, doing its thing.  A few more things I want to do today, but pretty happy with the way things are shaping up at the moment.



     

    lamentconfig  
    Share

    Your Reply