Submissions from 2015-02-27 to 2015-02-28 (4 total)

So, just as promised, did some coding today. Added an option to choose a name for the kingdom and also created a settings popup. Currently it contains only two buttons - save and load, though. :)

I also did some thinking about design and UI options for the game and also did some SEO for the Crystal Kingdom blog.

If you would like to support Crystal Kingdom, please consider liking its facebook page and following it on twitter.
Yesterday's update can be found here.
In a case of any questions or suggestions, don't hesitate to contact me here or on twitter. ;)

Today I got the 'loop' keyword basics working. So now on layout items you can do 'loop 2' or any number really, and it will repeat that layout content that many times. Now this isn't super useful in production but when you want to test a slideshow/navigation/carousel layout, it's great for quickly repeating yourself.

I also discovered a bug with how child elements are inserted with the 'children' keyword. Basically I needed to duplicate a components 'layout' block in memory or else the cached copy of the compilation would break across the entire codebase.

I've been messing around with grid based for a game similar to Shining Force or any other grid based tactical games. I wanted to be able to pick a spot on the grid and a movement amount and have the computer calculate all the spots that are available to move from there. I could use math to figure it out but because I'm lazy and like recursion I decided to use a modified flood fill (http://en.wikipedia.org/wiki/Flood_fill).

I created a flat grid and dropped a movement value of 8 somewhere in the middle and let my flood fill do the rest. Here's my result:

ArrayState.hx:110: ********************
ArrayState.hx:110: ********************
ArrayState.hx:110: **********0*********
ArrayState.hx:110: *********010********
ArrayState.hx:110: ********01210*******
ArrayState.hx:110: *******0123210******
ArrayState.hx:110: ******012343210*****
ArrayState.hx:110: *****01234543210****
ArrayState.hx:110: ****0123456543210***
ArrayState.hx:110: ***012345676543210**
ArrayState.hx:110: **01234567876543210*
ArrayState.hx:110: ***012345676543210**
ArrayState.hx:110: ****0123456543210***
ArrayState.hx:110: *****01234543210****
ArrayState.hx:110: ******012343210*****
ArrayState.hx:110: *******0123210******
ArrayState.hx:110: ********01210*******
ArrayState.hx:110: *********010********
ArrayState.hx:110: **********0*********
ArrayState.hx:110: ********************

* - are unreachable
# - how many movement is still available from each space.

Sorry about the funny formatting, but the Streak Club font isn't fixed width...

You can't see it here but this will flow around open spaces and takes into account different terrain which might cost extra movement to cross. Not bad for less than 10 mintues worth of work! I actually coded the recursive function correctly on the first try without catching myself in any infinite loops!


EDIT - Look at that. The Streak Club font is fixed width. Just not when I'm editing it. Live and learn.

EDIT 2 - No it isn't. It's close though!

EDIT 3 - Now it does. Thanks @Harley.

GCC

A submission for Code @Home 33

Didn't get much actually done today. I mostly fought with GCC and Binutils. Specifically, the linker and linker scripts and trying to compile with -nostdlib. I may skip this bit for now and come back to it as the stdlib works for now.