Grid spiral math puzzle

By aamenabar | Nov 22, 2008
I don’t know how to call this, maybe that’s why I haven’t found an answer after a whole day searching and calculating…

I want to create a function to fill a grid spiraling from the center, like in the image i have posted…

I don’t know how many turns it will have, so i have to calculate it, but the math for this eludes me, first I thought that approximating an Archimedean Spiral should do the trick, but it has constant radius, so, in the corners of the grid it doesn’t work after a few turns…

then i found a pattern in the frequency with which the "growth" changes direction, so I thought it was a progression, but never found the formula…

then i noticed, that I’t couldn’t be, because i’ts composed by x and y values, so I separated the x and y components, now it’s clearer, but still not any closer…

also managed to put together a function in which I tried to define the pattern, but it doesn’t even complete a full turn…

any help, suggestion, link, idea, formula, would be greatly appreciated…

I’m hoping to get the attention of some of the math gurus that hang around here… (Senocular, CyanBlue, cota, flashGordon, Mazoonist, the lot)…


Attached Thumbnails

30186
 

MVC Question

By Groady | Nov 22, 2008

I’m just looking for some advice on implementing an MCV design pattern for a game I’m developing in AS3.

Specifically I’m a little stuck on where I should be instantiating display objects from. I understand the model performs all the logic of a program and is unaware of any views reading from it. My problem is I need the model to be able to access certain display object so it can perform localToGlobal operations on them and their positions accordingly.

I can think of 2 ways to solve this but I’m not sure which way is better (or neither).

The first way is to pass a reference of the display object to the model (via the controller of course).
The second way is to instanctiate all view objects through the model with Factory methods, that way the model retains references to everything it creates.

I guess I’m just wondering if anyone has any suggestions or if their is any ‘official’ way to do it.

how to link swf files together ..?

By vans9140 | Nov 22, 2008
hello,

I am making a small flash movie for myself in terms of my design portfolio from school. I have spent the last few months getting acquainted with flash cs3 and feel comfortable as an intermediate flash user.

my question is this…

I have a series of buttons on the left side of the flash document stacked vertically … lets just call them 00_btn, 01_bth, 02_btn … through 05_btn. (to indicate year of design work)
At the bottom of the page, I have a bunch of small 10 x 10px movie clips that are horizontal across the bottom of the same page … I have named instances … pic1_mc, pic2_mc … through 25.
when the person clicks on these small movie clip symbols, i have a portfolio image show up on the stage.

HOW DO I ..? make it so that when someone clicks on the larger 00_btn -05_btn on the left side of the page … it goes to an identical page, with that button highlighted (current page) and loads a whole other set of images (of a different semester for instance) that shares the same set of small movie clips at the bottom to have images show up on the stage>>???

someone told me about loadLevel();

does that make sense?

here is the (unfinished) swf …

jasonflax.blogspot.com

© 2007 ActionScript 3.0