How do I a indication item on the edge of layout

Get help using Construct 2

Post » Tue Sep 27, 2016 12:36 am

I think something got misunderstood here.

This is as described in your image. The indicator is based on the x/y of the projectile, constrained to the viewport bounds. I think this isn't the end effect you are going for though...
https://www.dropbox.com/s/xy8pszf48lqo8 ... .capx?dl=0

If you want an indicator to show where the object is expected to enter the viewport based on angle of motion, you'll need to raycast and see where the ray intercepts the viewport bound and as 99instacesgo suggests. There are ways to do this without plugins as well, but it is an intermediate-advanced task. https://www.scirra.com/tutorials/902/li ... raycasting
Mistakes were made.
B
51
S
25
G
107
Posts: 1,581
Reputation: 60,458

Post » Tue Sep 27, 2016 3:49 am

hmm have you tried doing something like if missile is 100px away from layout edge and then sub event
I want to say like create the indictor at the edge and then every tick its new Y position and when missile is with-in layout stop following and destroy the indicator.

But i know that wouldn't work because you would have multiple of them and Im not sure how you would say lock each indicator to a missile without conflicting 50 other missile. Maybe using container such as instead of destroy the indicator you could simply make it invisible and when you destroy the missile you destroy its indicator ? so that when you go faster then the missile out of the screen it could reappear ?

this is just me brainstorming possibilities.

The hard question would be how would one code that logic without overwhelm the cpu event from re-firing when there is two different state for the missile object such as one could be in the layout and the other one on the outside at the same time.

But yeah you can try the plug-in never used them yet.
B
52
S
24
G
6
Posts: 391
Reputation: 7,845

Previous

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 19 guests