Pick Animation Maps
by Harrison Brock · in Torque X 2D · 02/18/2007 (3:20 pm) · 31 replies
I have 10 Animation map with about 30 frames each. I need a way to pick two animation at a time. These will be falling block. I know how to set the animation in the TorqueX editor because its the same as TBG. But how would I Random pick two of the animation maps here is what I need.
A = a animation map. B = a animation map.
When the game starts the images should be like this.
A
B
The player should be able to rotate a around B Like this.
BA B AB
A
I know I can mount the two together and dismount they when I need two. I just need help on get start with this.
A = a animation map. B = a animation map.
When the game starts the images should be like this.
A
B
The player should be able to rotate a around B Like this.
BA B AB
A
I know I can mount the two together and dismount they when I need two. I just need help on get start with this.
#2
A
B
to:
AB
Are you simply wanting to have it 'snap' to the new position like tetris?
If you are still interested in a solution, post back and I'll try to help you.

02/19/2007 (8:00 am)
I'm not quite following what you are wanting to do? Are you wanting to see the rotation from:A
B
to:
AB
Are you simply wanting to have it 'snap' to the new position like tetris?
If you are still interested in a solution, post back and I'll try to help you.

#3
02/19/2007 (11:47 am)
Yes but it will been do with animation maps and I will have to pick the animation map with a RandomFunction
#4
02/19/2007 (1:12 pm)
I guess I'm not understanding what an animation map is? You also said "yes" to a multiple choice question. I was asking if you want it to 'snap' to the new position or 'animate' to the new position?
#5
02/19/2007 (3:33 pm)
You might want to be calculating some angular velocity. Have you checked into the spaceshooter demo?
#6
02/19/2007 (3:59 pm)
U make an animation map in side the torqueX editor. Step one you import your image 2. than set up the frames.
#7
02/19/2007 (5:34 pm)
I think it would depend on what you were going to use the animations for. Are they mainly decorative, or will the be functioning within the game? What are you trying to do exactly, can you be more precise?
#8
02/20/2007 (2:52 pm)
Something this http://www.bigtimegames.com/images/ElviraShots/Elvira_MNS_GameBoard_01.jpg
#9
You will want to use a 2x2 2D array (if you are only using 2 objects).
A0
B0
00
BA
etc...
02/20/2007 (3:38 pm)
I see. You're wanting to do it like Tetris. As Jonathan mentioned in the second post.You will want to use a 2x2 2D array (if you are only using 2 objects).
A0
B0
00
BA
etc...
#10
02/20/2007 (7:22 pm)
But I have 10 animation maps. How would I random pick them
#11
02/20/2007 (11:42 pm)
How about with a pseudo random number generator?
#12
I don't understand why you are animating it if you want it like tetris. Just snap it to the new location. Take two objects and rotate them?

02/21/2007 (9:39 am)
Ah, animation map = animation =P I hadn't seen it termed with the 'map' at the end yet.I don't understand why you are animating it if you want it like tetris. Just snap it to the new location. Take two objects and rotate them?

#13
02/21/2007 (12:48 pm)
The blocks have animation. Each block has 30 frames of animations
#14
You are wanting to randomly pick a starting spot for the animation?
Does it repeat?
02/21/2007 (1:24 pm)
And does each block have multiple sets of the 30 frame animations or just 1 set?You are wanting to randomly pick a starting spot for the animation?
Does it repeat?
#15
02/21/2007 (2:00 pm)
@Harrison - I think a lot of us are having a hard time figuring out what you are having a problem with. Is the problem in figuring out how to randomly pick one item of a list of choices? Is it figuring out what data that you want to put into that list to pick out of? Is it figuring out how to create the T2DAnimatedSprite objects after you've randomly determined which of your animations you want to stick on the screen? All of that?
#16
02/21/2007 (2:49 pm)
I "think", from what I've gathered, is that he's wanting to use a T2DAnimatedSprite, and only show one frame of the animation. This frame is going to serve as a particular puzzle peice.
#17
If I were doing a tetris like game, I would have each 'block' with four mount points, a top, bottom, left, right and then dismount, and remount based on whatever new spot I want it to go to.

02/21/2007 (2:57 pm)
Derrick's explanation is what I was getting from it, but I wasn't understanding why you would do that versus either replacing with another static sprite or simply rotating the sprite in question (or mounting and moving where it's mounted to)If I were doing a tetris like game, I would have each 'block' with four mount points, a top, bottom, left, right and then dismount, and remount based on whatever new spot I want it to go to.

#18
02/21/2007 (3:20 pm)
@Derrick and Jonathon - I may be wrong, but I think that what he wants is to do a tetris-like thing, with each sub-block as a T2DAnimatedSprite. If I'm interpreting correctly, the problem he has is that he knows how to create this with two specific animations (i.e. just drag the two that you want into the level) but he wants to figure out how to generate his combination of blocks dynamically, as the game goes on, so that each new combination that starts falling down from the top of the screen can be different. Basically, I think his question is about dynamic creation of objects, not how to use animated sprites in a strange way as you guys are thinking. But I could be wrong. So hopefully he'll clarify a bit about what he actually wants to do, so we can provide help that he actually finds helpful. :)
#19
A. I need to pick two block.
1. Each block will play its animation every 30 seconds.
2. Each block is a T2DAnimatedSprite
B. The blocks will fall from the center of the screen.
C. The next set of block will not fall until the first set has hit the button of the screen.
D. One block will be able to rotate around the other.
How do I randomly pick two blocks?
02/21/2007 (3:25 pm)
Hey let me try again.A. I need to pick two block.
1. Each block will play its animation every 30 seconds.
2. Each block is a T2DAnimatedSprite
B. The blocks will fall from the center of the screen.
C. The next set of block will not fall until the first set has hit the button of the screen.
D. One block will be able to rotate around the other.
How do I randomly pick two blocks?
#20
A. I need to pick two block.
1. Each block will play its animation every 30 seconds.
2. Each block is a T2DAnimatedSprite
B. The blocks will fall from the center of the screen.
C. The next set of block will not fall until the first set has hit the button of the screen.
D. One block will be able to rotate around the other.
How do I randomly pick two blocks?
02/21/2007 (3:48 pm)
Hey let me try again.A. I need to pick two block.
1. Each block will play its animation every 30 seconds.
2. Each block is a T2DAnimatedSprite
B. The blocks will fall from the center of the screen.
C. The next set of block will not fall until the first set has hit the button of the screen.
D. One block will be able to rotate around the other.
How do I randomly pick two blocks?
Torque 3D Owner Harrison Brock