Following on from yesterday's post I decided to act on my own suggestion and make a 3-channel version of the Game of Life shader. The result is here on Wonderfl and embedded below, with the full shader code as a comment at the end of the source on Wonderfl.
Friday, 30 March 2012
Thursday, 29 March 2012
Game of Life shader
This is another simple and quick shader, this time done to see how easy it would be to implement Conway's Game of Life after seeing the same logic implemented using filters. It's an ideal fit for shaders not only as the code that runs on each pixel is identical but also as the 'game' is essentially a graphics algorithm. Turned out to be every straightforward, taking only an hour to write, test and deploy here at Wonderfl.
Wednesday, 28 March 2012
Practical optimisation
While browsing on Wonderfl to see how my cross product shader was doing I came across someone else's code, the evocatively named "forked from: flash on 2012-3-23". Running it I noticed it was slow: it was not doing much but got slower and used more CPU as it ran. So I decided to look into it.
Tuesday, 27 March 2012
Cross product shader
This is something I did to try out the mathematical functions in Pixel Bender's shader language. I also wanted to work out how to upload an image to Wonderfl, and upload another more interesting shader example to there. Seeing how its turned out I can't imagine using in game though with a bit of work it could produce some interesting effects which might be useful.
Monday, 26 March 2012
Radial gradient fill
I first tried using gradient fills (via the beginGradientFill method of the Graphics class) in Bug Tunnel Defense. I wanted to use them for shading along the tunnels but could never get them to work, and eventually did it the long way by drawing a series of differently coloured rectangles. The problem was the createGradientBox Matrix function, which no matter what I passed to it would never return the right matrix for a linear fill.
Friday, 23 March 2012
More shaders
I wrote two new Shaders today. One is for a screen that's not in the game yet, which the Shader will be a fundamental part of. As the Shader is rather complex I wanted to write it first to see if what I wanted to do was possible. It seems to work, so now I need to write the code for that screen.
The second is much simpler. It does edge detection on the layer I added yesterday, to highlight the boundary of the region indicated. The Shader code is very straightforward and it took much less time than either of the other Shaders I've done for this game.
The second is much simpler. It does edge detection on the layer I added yesterday, to highlight the boundary of the region indicated. The Shader code is very straightforward and it took much less time than either of the other Shaders I've done for this game.
Thursday, 22 March 2012
Screenshots
Catching up today after spending much of yesterday performing my civic duty, and spent some time adding a new graphical layer that slots between existing layers in just the right way. I had to re-work a few things to get it right, but the result not only looks better and helps a lot in the gameplay but is a little more efficient to draw.
Wednesday, 21 March 2012
Review: Triple Town
Triple Town by Spry Fox started out on the Kindle, but I first noticed it on Facebook and subsequently on Google+, one of the first game on that platform. Most recently it has been released for iOS devices.
Tuesday, 20 March 2012
Linked lists + screenshots
I moved some of my data structures over to linked lists today, in preparation for adding more functionality and gameplay. I was once fairly sceptical of their applicability in Flash but I've been persuaded around by the performance work I was doing a few months ago. In particular the overhead of accessing array (Vector or Array types) members is non-trivial, comparable to other function calls. I may do some performance tests to confirm this but I'm pretty sure this is an optimal solution for what I'm doing.
Monday, 19 March 2012
Ball-ball collisions
In this post I discussed how to handle collisions in general, at least when one of the objects is a ball for collision purposes. My intention was to follow it up with an example but I never got around to it. Well now I have, and it shows how to turn the theory in that post into practice.
Subscribe to:
Posts (Atom)


