Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Director follow sprite pActivate and vFollow calls from other sprites

Status
Not open for further replies.

medianerd

Programmer
Feb 7, 2002
3
US
I am in the process of producing a puzzle game. 12 pieces that make up a picture. I have a snapTo routine in place and I want to then link one piece to another so the two 'snapped' pieces travel together. Does anyone have any helpful information or suggestions on the calls I can make from one sprite to follow another?

Thank you for your effort in advance. I will gladly share my efforts with the crowd when finished.

Thank you,

mn
 
have you tried using sendAllSprites

When two pieces have joined together, have a property variable set to TRUE and when one is being dragged use senAllSprites to tell all the other sprites which have the proprty set to TRUE.

Mayuresh
 
manabenz,

tthanks for the reply.

I get the drift on the sendAllSprites. I do have a list make up to track who is joined with who, but aat this point that does not apply yet. I guess I am currently stuck on how to use the Floow Sprite function. I see this as one class calling another class's function from within the sprite that is moved with the mouse. I have been getting a compile error when writing the line that makes the call.

I was looking at the on-line help for some documentation on the use of this function. Again I am new to the sprite feature and see it as well as approach it as an interface class in C++ or JAVA. And these are not my best suit either.

Any examples you know of that use this function?

Thanks,

mn
 
If your allowed to do so, can you post a sample file of what your doing. That would make things a lot clearer.

Mayuresh
 
manabenz,

I am certain that what I had described to you was somewhat puzzling now that I have been able to play around with the follow sprite behavior. I am just beginning to get acquainted with director. Actually what I see as my need at this time is a combination of the public methods of follow sprite with the grouping capabilites of the multiple sprite drag. A mutation of these two would present a capabiiliity of toggled activity and sprite assignment.

In follow sprite, I like the code for calculating the registration point of a sprite. Also the tracking mechanism is useful.

Out of multiple drag sprite the group and relocation routine is what the puzzle needs.

Then writing code for each puzzle piece of what sprites it is adjacent to will provide the logic to tie it all together.

I am in the process of analizing the behaviors and will give you some feedback soon.

thanks for you help.

mn
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top