Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

3 nested loop issue

my brain is starting to hurt at getting this loop right. here is what im using:
[rgss] 
for h in 0...625
   for i in 0...24
      for j in 0...24
          if @count > 100000
            Graphics.update
            @count = 0
          end
          @count += 1
          Data[h] = My_Data.new(false,i,j)  
     end
  end
end
[/rgss]
i know im doing this all wrong :(

what im trying to do is create 625 entrys in Data[] i want this to happen(so you can see the pattern im looking for)

Data[0] = (false,0,0)
Data[1] = (false,0,1)
Data[2] = (false,0,2)
Data[3] = (false,0,3)
Data[4] = (false,0,4)

then latter...

Data[623] = (false,24,22)
Data[624] = (false,24,23)
Data[625] = (false,24,24)

i know its wrong because every entry ends up being (false,24,24) and as dumb as it sounds i cant figure out the right way to loop it.(yes i know why its wrong, i cont. overwrite i an j)
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top