Really need direct communication between actors!
Hunnenkoenig
Member Posts: 1,173
In my game there are actors, which have shields around them.
I spawn the shield from the actor with an attribute. If attribute "shield" is true, spawn actor "shield".
Now I want it so, that when the ball hits shield, it disappears and then the ball can hit the actor again and then the actor disappears.
Because of very complex rules with many attributes I can't change the whole thing, and it also wouldn't make sense.
Now my problem is, that I can't tell the actor, when the shield was hit to make other actions and set other attributes to true or false or such.
I have many of the same actors and I would have to make them all an own game attribute to check if its shield was hit or not.
Now I can't make the shield disappear on colliding with the ball, because my actor won't receive the command to change other needed attributes, so I have to disable the shield on overlaping, but then it happens sometimes that my ball don't make contact with the actor, but only with the shield and it looks like I would have to hit the actor 3 times instead of 2 times.
I can live with it if it has to be, but I would prefer my initial plan.
That's why we really need the possibility to change attributes between actors directly.
If that mad sense to you.... :-)
I spawn the shield from the actor with an attribute. If attribute "shield" is true, spawn actor "shield".
Now I want it so, that when the ball hits shield, it disappears and then the ball can hit the actor again and then the actor disappears.
Because of very complex rules with many attributes I can't change the whole thing, and it also wouldn't make sense.
Now my problem is, that I can't tell the actor, when the shield was hit to make other actions and set other attributes to true or false or such.
I have many of the same actors and I would have to make them all an own game attribute to check if its shield was hit or not.
Now I can't make the shield disappear on colliding with the ball, because my actor won't receive the command to change other needed attributes, so I have to disable the shield on overlaping, but then it happens sometimes that my ball don't make contact with the actor, but only with the shield and it looks like I would have to hit the actor 3 times instead of 2 times.
I can live with it if it has to be, but I would prefer my initial plan.
That's why we really need the possibility to change attributes between actors directly.
If that mad sense to you.... :-)
Comments
Otherwise...its really more procedural and not more object oriented.
I think we will get it eventually...just not sure when.
1. each player Actor can have a shield Actor.
2. each shield Actor would constrain to the position of the player Actor.
3. each actor has its own Actor Attribute called `Shielded,` and initially set to TRUE.
4. when the ball Actor collides with the shield Actor, destroy the shield Actor.
5. when the ball Actor collides with the player Actor,
if `Shielded` Attribute is FALSE, destroy player Actor, else
change `Shielded` Attribute to FALSE.
Steps 4 and 5 should happen simultaneously, assuming the collision boundaries are identical.
It is complex and I don't want to explain it in detail, because it is boring :-)
My main problem was, that I would have to overhaul the whole actor.
Now I tricked a little bit and I managed it relatively simple. I wanted to edit my main post, but then you both already posted :-)
Now I don't need direct communication so desperately any more, but It would make life easier though :-)
KEYWORD: OPTIMIZATION!!!
Maybe optimization is good, but honestly, I am already bored with this game :-)
I want it having out on the store and start another.
A bit later I can come back and make updates, but now all I want to finish it.