Destroy outside Layout ? I want Destroy out of window size

Discussion and feedback on Construct 2

Post » Fri Apr 24, 2015 6:40 pm

The layout is long because it is platform, I want the bullet to be destroyed right outside the viewable area, not to go into areas I can't see and kill all the bad guys already.
How do I do that ?
B
12
S
3
Posts: 288
Reputation: 1,694

Post » Fri Apr 24, 2015 6:43 pm

Compare X

Bullet.X > ViewportRight("Layer")
destroy bullet
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,592

Post » Fri Apr 24, 2015 6:45 pm

If you spawn the bullets inside your viewable area.. put down a "Is on screen"-condition, right-lick, invert. Then it gets the red X and means "is not on screen".

If you spawn outside of the visible area you need add a bit more logic, because otherwise it would be instantaneously destroyed.
B
79
S
29
G
32
Posts: 482
Reputation: 19,915

Post » Fri Apr 24, 2015 8:46 pm

X is on screen - destroy
Sea Monsters template - Isometric
Also includes 40 pages PDF of optimizations and "how-to" for your games, and how the "sea monsters" template was built. Follow link for details :)

sea-monsters-templates-and-assets_t162705
B
43
S
14
G
12
Posts: 626
Reputation: 9,455

Post » Sat Apr 25, 2015 8:17 am

THANK YOU EVERYONE :D
B
12
S
3
Posts: 288
Reputation: 1,694


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 15 guests