Compare the number of objects

For questions about using Classic.

Post » Thu Dec 11, 2008 6:29 am

How do you do this in Construct? I don't know, even after using it for so long, I still have trouble finding things in the event editor since I am so used to the way Clickteam products are laid out (even though I haven't used a CT product in a long time).

I'm trying to make it so that the player can only fire a bullet object when there is less than three bullets on screen.

In, say MMF or The Games Factory, for example. I would do this by

(Condition)
Upon pressing "Z" key
+ Number of "bullet" < 3

(Action)
Create "bullet" at "player"

But I can't seem to find the thing that counts (compares) how many objects are on screen. Where is it in Construct?
B
2
S
2
G
4
Posts: 153
Reputation: 1,756

Post » Thu Dec 11, 2008 6:51 am

Just use compare under System and use object.Count where object is the name of your whatever.
Moderator
B
98
S
37
G
19
Posts: 1,584
Reputation: 17,817

Post » Thu Dec 11, 2008 7:33 am

"Get number of objects" can be used in any expression, not just system compares. You access it from any expression editor by clicking on the object you want to count.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Thu Dec 11, 2008 3:13 pm

[quote="deadeye":5a41ih9m]"Get number of objects" can be used in any expression, not just system compares. You access it from any expression editor by clicking on the object you want to count.[/quote:5a41ih9m]

I know that, I'm just saying for his particular example
Moderator
B
98
S
37
G
19
Posts: 1,584
Reputation: 17,817

Post » Thu Dec 11, 2008 4:52 pm

[quote="linkman2004":21h6jfdm][quote="deadeye":21h6jfdm]"Get number of objects" can be used in any expression, not just system compares. You access it from any expression editor by clicking on the object you want to count.[/quote:21h6jfdm]

I know that, I'm just saying for his particular example[/quote:21h6jfdm]

I know that too, I was just telling machrider, and other people in general who might be reading this thread :P
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Thu Dec 11, 2008 6:22 pm

Okay, thanks. Yeah, I wasn't checking under system, I didn't expect it to be there. I was looking under the object itself because MMF/TGF and other CT products usually have the compare condition listed there. Old habits die hard, I guess.
B
2
S
2
G
4
Posts: 153
Reputation: 1,756


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 6 guests