View Single Post
  #1  
Old 06-08-2005, 05:27 AM
calani calani is offline
Scriptess
calani's Avatar
Join Date: Aug 2003
Location: asmgarden.gmap
Posts: 606
calani is on a distinguished road
Send a message via AIM to calani
Multidimentional arrays

I recently started a project that should have been fairly simple - a rudimentary 2d gravity simulator. I was later going to make this into 3d and have some fun with it after i got the basics working.. however, I encountered a very annyoing problem: I couldn't get my array to work.
Hearing that GS2 had multidimentional array support (yes, I'm behind the times a bit due to being extremely busy), I arranged everything so it would be easy access and keep the script looking clean.

here's my array format:
objects_array={object,object,object,..}
object={image,{x,y},{dx,dy},{movable,mass}}

so, a sample two object array would be:
{{"crystalflash.gif",{3,-3},{-2,1.8},{1,500}},{"crystalflash.gif",{60,28},{-3,-1},{1,256}}

I haven't been able to get setarray( ) to work with this... I tried setting it to the number of sub-arrays, and then setting each individual array element, but reading them always returns a zero.


What am I doing wrong?
__________________
Reply With Quote