set formations?
Dooki
Member Posts: 247
Hey there,
- I have an army to set up. About 10 soldiers let say.
- Is there a way to set a control button that will assemble the soldiers in a particular formation?
- If so, then is it possible to create a couple of buttons allowing you to have several formation options?
- Once the the formation is set the will move as a group formation.
- What I am imagining is a few buttons along the bottom that will allow me to set formation and then one final button that will give the charge order!
Thanks,
-Dooki
- I have an army to set up. About 10 soldiers let say.
- Is there a way to set a control button that will assemble the soldiers in a particular formation?
- If so, then is it possible to create a couple of buttons allowing you to have several formation options?
- Once the the formation is set the will move as a group formation.
- What I am imagining is a few buttons along the bottom that will allow me to set formation and then one final button that will give the charge order!
Thanks,
-Dooki
Comments
-Dooki
Drag ten soldiers to the stage. (this won't work if you spawn them)
Set a game integer : formation = 1
Then in one of your soldiers set up the positioning rules. ie...
when formation = 1 then
set x = 20, set y = 20
when formation = 2 then
set x = 40, set y = 20
etc etc...
then copy those rules, and paste them into all your other soldiers. Then edit each soldier so they are all in the formation you want.
also add a rule to each soldier
when charge = 1
set self.motion.x = 300
Slow, and heaven help you if you need to make lots of changes. Good luck!
Hopefully they'll bring out sprite to sprite coms/arrays and this would be much easier.
Create a separate actor for each soldier or be ready to click on each instance and edit it.
Create an integer game attribute called formation (or whatever you want)
In each soldier have a rule that says
when game.formation = 1
move to (enter coordinates for first formation for this soldier)
when game.formation = 2
move to (enter coordinates for 2nd formation for this soldier)
and so on. You will need to do this in each soldier for each formation.
Then have some buttons that when pressed change game.formation to a certain number making the soldiers line up.
So as you can see possible, but very tedious!