Spawning objects in puzzle game
by Justin Greywolf · in Torque X 2D · 04/02/2010 (1:09 pm) · 4 replies
OK - I am having a complete brain wipeout here, as I cannot figure out how to implement the following:
Generate multiple sprites with different letters and fill up a "container". After making a word, those tiles disapear, everything around them falls to fill the empty space, and new tiles fall into place...
I am trying to recreate a game I had originally created in XNA 2.0. Unfortunately I lost that code in HD failure, and for the life of me cannot remember how I did it then...
I have been going through all the tutorials and references I can find on TX2D, and have purchased the book "The Complete Guide to Torque X", and now impatiently awaiting it's arrival ;)
Wondering if someone could steer me in the right direction to get started on this in the meantime (I was also trying to implement this in TGB, and just started learning TorqueScript couple of days ago).
(I should add that I have material in editor already that contains the sprites with each letter, so 28 frames (2 have non letters) - the way I did it last time was with one image and adding text on top of that when spawned)
Thanks!
Justin
Generate multiple sprites with different letters and fill up a "container". After making a word, those tiles disapear, everything around them falls to fill the empty space, and new tiles fall into place...
I am trying to recreate a game I had originally created in XNA 2.0. Unfortunately I lost that code in HD failure, and for the life of me cannot remember how I did it then...
I have been going through all the tutorials and references I can find on TX2D, and have purchased the book "The Complete Guide to Torque X", and now impatiently awaiting it's arrival ;)
Wondering if someone could steer me in the right direction to get started on this in the meantime (I was also trying to implement this in TGB, and just started learning TorqueScript couple of days ago).
(I should add that I have material in editor already that contains the sprites with each letter, so 28 frames (2 have non letters) - the way I did it last time was with one image and adding text on top of that when spawned)
Thanks!
Justin
#2
Question - and yes I could probably look this up, but asking real quick here ;) Can you set which frame of a material a particular instance of a template is using?
Justin
04/02/2010 (5:28 pm)
That is something I was considering. Question - and yes I could probably look this up, but asking real quick here ;) Can you set which frame of a material a particular instance of a template is using?
Justin
#3
04/03/2010 (3:50 am)
I'm not sure if its possible for static sprites but you can make your material into an animatedsprite that contains your material frames and choose in there
#4
04/03/2010 (8:05 am)
You want the confusingly named MaterialRegionIndex property of T2DStaticSprite :)
Torque Owner Raymond Ku
no studio
make a template object in your tx2d editor
then have a component that can change the active display to any letter necessary.
Then I would just use the clone() function to make as many letter tiles you need. They can be deleted when you dont need them, and can create more when you need more in code.