Doh! ... Anyone fancy solving a maths problem... Before I redo it..
OH Ffff.... DOH!
I hadn't given much thought to the repercussions to the way my home made grid spawns each square.
The grid starts at the bottom in the middle, and spawns above from left to right, going directly up the screen.
It works.
But now I want to be able to know the grid numbers for the squares adjoining any chosen square.
And cause I made it in a stupid way, I can't make the maths work.. So I'm gonna end up redoing it later tonight.
Had I made it so the grid was spawned in rows diagonally from bottom to top left and started again at the bottom for the next column it would be a whole lot easier. As it would go, 1,2,3,4,5,6,7,8,9,10 along one side and everything would be in nice tidy multiples of.
Out of interest, and as a pointless challenge. Can anyone see a pattern/formula that would give you the adjoining squares grid number.
For reference:
You have each cells given row and cell number. Plus their own grid number (which is the order in which they're currently spawned).
(in the end the grid might not be spawned at all, but until I settle on the preferred size it's nice to be able to quickly play around with values and test..)
Not the end of world re-making it and I will... but it's annoying me that I can't figure out some maths to make it work as is.
Comments
Are you sure you want the squares numbered in this way? Wouldn't it be more useful to number them as a simple 2 dimensional array? (Its only your perspective that has shifted. The data structure is still a 2 dimensional array.)
@Rthurman absolutely, it just did'nt cross my mind when I first made the thing. (Also it looked quite cool when I had them 'bouncing into existence' from the bottom and working their way up).
Fixed... this is how I want them numbered ... I err think...
Only had to tweak the spawning rules a little bit in the end to get it to spawn in this order..
Yes -- that's what I was trying to say.
But I would probably number them in the opposite way -- so that node 11 would be numbered "2", and node 21 would be numbered "3" and so on. But maybe that's a perspective thing again. (It seems to me that the bottom row starts at 1 and then goes to the right.)
I think your right..
Though actually to make it all the more normal to think through.
I guess 1 should be in the top left (where 10) currently is.
and 10 should be where 1 is, 20 where 11 is...
it really should'nt be this hard... (I blame last nights pub quiz yet again)
Yes, top left makes sense too.
If last night's escapades are making things are a little hazy today, can I suggest you review a really brilliant template called 'Stormys GS Table-izer'? Its free!
lol!
@StormyStudio It's great to see your triumphs and tribulations with this project.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
@RThruman Do you actually ever make use of my Table-izer?
@tatiang thanks... I think. :-)
...
Here's the fixed thing... numbered a bit better again...
Also made it so the first square can be positioned anywhere in the scene.. it's then snaps its position to a nice round number (getting rid of those pesky decimal points) and spawns the rest of the grid.
note to self... when I try and leave the pub, don't succumb to offers of free beer.
@Socks is who you need to have take a look. The guy is a math wiz.
I really am having a slow day.. only now do I see what your getting at... spawning a big grid of cells successfully in a normal fashion.... Old me was much better than todays me.
Yes!
@FallacyStudios , you need @RThurman if you need a practical math solution, you need @Socks if you also need the solution to work on a ferris wheel.
aaand runs away
sorry @Socks
MESSAGING, X-PLATFORM LEADERBOARDS, OFFLINE-TIMER, ANALYTICS and BACK-END CONTROL for your GameSalad projects
www.APPFORMATIVE.com
Lol !
There is a lot of truth to that !!
@RThurman is the man for this job !
http://forums.gamesalad.com/discussion/40511/make-wheel
http://forums.gamesalad.com/discussion/comment/413450/#Comment_413450
umm... sorry for the thread hijack
damn ... guess I'll have to come up with cartoons for @RThurman now too.
MESSAGING, X-PLATFORM LEADERBOARDS, OFFLINE-TIMER, ANALYTICS and BACK-END CONTROL for your GameSalad projects
www.APPFORMATIVE.com
Runs off to implement code... what the... a ferris wheel ? with lights and everything.. brilliant.. oh but no candy floss stall.
"candy floss stall"
What the...???
Speak English man! Do you mean 'cotton candy stand'?
He does. I had to Google it. Candy floss... what a name!
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
You guys and your crazy French.
Dropping a zip of a video of an old iso project I had. Don't have time right now to clean up the project for YouTube or marketplace. Not sure if there is anything still interesting to use in that. It needs to be updated for with the new GS when I get the time.
Thanks @CodeMonkey strangely similar to my own thing. I like the fact you'd gone the same route with your spawned grid as I did at first.. from the middle and up.
Now mines lined up in a normal array style it does make maths a whole lot easier.
spawning that way makes sense because it is easier to spawn them at the back of the layer so the older tiles are at the top and give it a nice layered effect.
You can just use a table to figure out their correct row/column. That project pre-dates tables, so I didn't have that option.
Lol !
Look what these philistines have done to our language !
What are you people talking about? Everyone knows that the good old U. S. of A (especially the mountains of Appalachia) contains the truest forms of Shakespearean English.