How do I test if Object is on Layout?

Get help using Construct 2

Post » Tue Feb 16, 2016 2:04 am

Hey guys,

i was wondering if there is a possibility for testing if there is still a "Enemy" on the Layout.
because "on screen" is not the same, if the layout is bigger than the screen itself.

Or is there a other easy solution?
I would like to skip the possibility with counting the enemys and making a variable.

kind regards
B
9
S
1
Posts: 50
Reputation: 646

Post » Tue Feb 16, 2016 2:37 am

There's a built in function to check if something is still in the layout.
Add event -> Select enemy sprite -> Scroll to "Size & Position" (or search "outside layout") -> Select "Is outside layout"
B
4
S
1
Posts: 3
Reputation: 276

Post » Tue Feb 16, 2016 2:54 am

You can go to system and Compare two Values like Enemy.Count <= 0 that if you want to make something happen if there is no enemy

but if you want to know how much enemy are in layout just make a text and set the text to enemy.Count this will display the quantity of enemy on layout.

[Object].Count - will count all the object that exist inside or outside the layout and will get it quantity as and int.

hope this help ya Good Luck!
B
4
Posts: 4
Reputation: 208

Post » Tue Feb 16, 2016 3:53 am

vendara wrote:Hey guys,

i was wondering if there is a possibility for testing if there is still a "Enemy" on the Layout.
because "on screen" is not the same, if the layout is bigger than the screen itself.

Or is there a other easy solution?
I would like to skip the possibility with counting the enemys and making a variable.

kind regards


If you want to test if there is an enemy in the layout, you can try this:

Enemy.Count = 0

or if you are targeting a specific object using UID's then you can use the System Condition:

System --> Object UID exists.
Image



The Things you can create is only limited by your imagination. If you don't have the skills then use your motivation as a natural force to exceed all expectations. Chadori RebornXD
B
51
S
17
G
90
Posts: 1,108
Reputation: 59,024

Post » Sat Feb 20, 2016 8:33 pm

LordZarta wrote:You can go to system and Compare two Values like Enemy.Count <= 0 that if you want to make something happen if there is no enemy

but if you want to know how much enemy are in layout just make a text and set the text to enemy.Count this will display the quantity of enemy on layout.

[Object].Count - will count all the object that exist inside or outside the layout and will get it quantity as and int.

hope this help ya Good Luck!



Thank you guys, it worked :)
B
9
S
1
Posts: 50
Reputation: 646


Return to How do I....?

Who is online

Users browsing this forum: MAVERICK, tarek2 and 5 guests