Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / grouping objects

Author
Message
The admiral
22
Years of Service
User Offline
Joined: 29th Aug 2002
Location:
Posted: 28th Dec 2003 06:55
Im looking to be able to group some of my objects together so that they can be moved around etc as one group but im not sure the best way to go about it. Whether i should be using an array or a stack or a something else. What im looking for is a bit of advice about how i should do this. Thanks for your advice if you can offer it.

[href]www.vapournet.com/~flyer[/href]
ReD_eYe
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 28th Dec 2003 10:48
easiest way would be to make an array which holds all the object numbers of the grouped objects then use a function to move them all together.


GO TO THE ETERNAL DESTINY FORUMS!!! http://forums.eternaldestinyonline.com
Do it now!!!
Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 28th Dec 2003 18:02
quick and dirty group selection



click once to start the selection and then again to close the box, when you press the upkey all the objects in the rectangle move up off the screen, cheers.

Mentor.

System spec : Pentium 3.0Ghz, 512MB DDR, 2x160Gb HD (using icewave hd coolers ), DVD RW/CD RW (all modes), multimedia front panel, 6 way surround sound, ATI radeon 9800Pro 128mb.
Xander
21
Years of Service
User Offline
Joined: 3rd Mar 2003
Location: In college...yeah!
Posted: 28th Dec 2003 23:49
Is this for a RTS game?

In mine I have formations that can be set. When robots are selected you can assign them to formations. It then records the selected robots' positions into the formation arrays. When the formation is selected then those robots are selected. When the mouse is clicked somewhere to move them, it uses the point where the mouse was clicked as a center point. All of the robots' positions in the formations are averaged to find a center point. Then offsets are calculated for the robots and they are moved to their new points.

I can give you some code if you want, but right now I am really busy...

Good Luck

Xander - Bolt Software

Don't pat yourself on the back too often, you might hurt yourself

Login to post a reply

Server time is: 2024-11-25 22:40:50
Your offset time is: 2024-11-25 22:40:50