Object within angle and within range

Get help using Construct 2

Post » Mon Jul 02, 2012 3:29 pm

Of course it is possible to go with an invisible "collision sprite" which is attached to the Bot object. But in my final application I will have a lot of objects on the scene at the same time and then it will be crucial for the performance to not having to use 2 sprites for each Bot object. As that will slow down performance.
B
8
S
3
G
2
Posts: 45
Reputation: 2,186

Post » Mon Jul 02, 2012 3:38 pm

hmm if 2 sprite will slow the performance the events will do that too so easy events (so you can edit when ever you want) or hard event?
B
45
S
15
G
6
Posts: 795
Reputation: 11,935

Post » Mon Jul 02, 2012 3:52 pm

But I'll have like 100 instances of the Bot class. And then there will be a quite big change to add 100 sprites more as I'm sure you understand.
That will effect the performance more than a couple of events.

Though I'm not sure if it's possible to do this with just events. So I might have to go with the collision sprite solution anyway.
B
8
S
3
G
2
Posts: 45
Reputation: 2,186

Post » Mon Jul 02, 2012 5:18 pm

ok lets start over and explain what you want and use this instead of your box to know where you want the player to face


about 100sprites 0.0 what kind of game you will do? and does those sprites have animations or just 1 frame?
B
45
S
15
G
6
Posts: 795
Reputation: 11,935

Post » Mon Jul 02, 2012 8:59 pm

I had a go at it, I'm not sure how stable it is, but you can give it a go if you want:

WithinDistanceAngle.capx (r97)Nimtrix2012-07-02 20:59:26
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Mon Jul 02, 2012 9:29 pm

Thank you Nimtrix!
As usual you delivered a perfect solution! :)
That was exactly what I was looking for!
B
8
S
3
G
2
Posts: 45
Reputation: 2,186

Previous

Return to How do I....?

Who is online

Users browsing this forum: bluemonkey, Khamsou and 20 guests