Actors impact
Hi I need some help with the collision between same actor.
I have one actor that's a circle. This actor spawn in the scene with different directions. The problem is that when they collide without drag them, I need to know wich is the angle of collision. I know how to make with different actors, but I don't know how to do with same actor.
I have one actor that's a circle. This actor spawn in the scene with different directions. The problem is that when they collide without drag them, I need to know wich is the angle of collision. I know how to make with different actors, but I don't know how to do with same actor.
Best Answers
-
MotherHoose Posts: 2,456
@mozoo …
in the demo …
the circles collide and changeAttributes for the game collide positions
have the circle spawn the union animation
when animation is complete … have unionAnimation spawn the circle2
@jckmcgraw … great tip!MH
-
RThurman Posts: 2,881
Does this demo get close to what you want to do? (Sometimes its faster to create a demo then to try to write down the steps.)
http://www.mediafire.com/download.php?dg005cq4v2jtfb5
Answers
I'm sorry, but I don't understand your question entirely. Could you maybe explain your problem again?
try:
add a gameAttribute … index type … name: spawnCount
in the spawnerActor:
before the spawn
… add behavior … changeAttribute: game.spawnCount To: game.spawnCount+1
-do spawn
depending on how many circleActors onScreen
you will need for each … gameAttributes
collide#X
collide#Y
and 1 attribute for impactAngle
on circleActor:
1st behavior: changeAttribute: self.Name To: game.spawnCount
Rule: when
Event: overlaps or collides with actor of the type circleActor
-Rule: when
-Attribute: self.Name is 1
---changeAttribute: collide1X To: self.Position.X
---changeAttribute: collide1Y To: self.Position.Y
-Otherwise:
--Rule: when
--Attribute: self.Name is 2
---changeAttribute: collide2X To: self.Position.X
---changeAttribute: collide2Y To: self.Position.Y
etc.
changeAttribute: game.impactAngle To: vectorToAngle(x,y)
==
it might be easier to recycle the circleActors
and, also … store the collide values in a Table … and use for vectorToAngle
I tried this with 2 circleActors … worked just fine
The number of circle actors is uncertain, because they appear and you can drag them so it's not possible to know the exactly number.
I will try it and i will see what happens!
Thx
The number of 1levelcircle is uncertain.
I achieved to find the angle of collision when I drag one of the 1levelcircle and collide with another one. The problem is when 1levelcircle collide random. I don't know how to find the (x, y) position of the two 1levelcircles.
Thx
well got it to work with 8 circle1 actors …
IMO … angle of impact is not needed … angle is created by the X,Y position of collidingActors
demo: http://www.mediafire.com/?0vphb2stvxrf1h6
hope this helps
In the game when two "1circles" collide, spawn a new actor "union". When the actor "union" is destroyed appears the actor "2circles". The problem is that "union" actor is a animation of how two "1circles" are fusioning. The problem is that I need to find this angle to rotate de animation according to the collision point.
I dont know how to find the (x,y) position of this two circles when they collide random. The number of 1circle actor is uncertain because during the game they appear from diferents points and with different directions.
Thx
Thank you guys! now I can continue