Arrays and what not
by rennie moffat · in Torque Game Builder · 02/16/2010 (8:59 pm) · 4 replies
it has come to my attention that I need to program using arrays if I want to do anything serious on any level. So I am wondering, beyond TGN library, what are my options to study. I understand the basic concept and I am comfortable with the idea, and I have a C++ book which I reference from but I am wondering if someone can point me in any hidden treasures of learning arrays.
Thanks
Ren
Thanks
Ren
About the author
My thanks to Garage Games and the Garage Games Community combined with owned determination I got one game up, Temple Racer and I am looking to build more interesting, fun games for the mass market of the iOS app store.
#2
I have an object where there will be infinite clones, any number above a 100 will do per level. These items are picked up by the player and dropped, scoring points as they free fall down. The player must go back to the load spot and pick up another. So my main I idea to have the array is so that it will handle loading a pickUpItem. Each time one is picked up, another replaces it.
Thats it really. I have coded it, but with pickUpItem1, PickUpItem2 etc.
Am I thinking about this right?
02/17/2010 (10:10 am)
Just to be sure that I am thinking about this correctly. What I am doing in my game and indeed if I need an array, tho I am quite sure I do, confirmation would be good to hear.I have an object where there will be infinite clones, any number above a 100 will do per level. These items are picked up by the player and dropped, scoring points as they free fall down. The player must go back to the load spot and pick up another. So my main I idea to have the array is so that it will handle loading a pickUpItem. Each time one is picked up, another replaces it.
Thats it really. I have coded it, but with pickUpItem1, PickUpItem2 etc.
Am I thinking about this right?
#3
02/17/2010 (3:06 pm)
I guess you might be able to use an array for this. I'm not entirely sure of what your end code might look like, since there are probably several ways to accomplish what you want. The array docs I linked are just an example of how they can be used, so it will require your own interpretation.
Community Manager Michael Perry
ZombieShortbus
Array Examples