How do I evaluate an object clicked?

Get help using Construct 2

Post » Sun Jul 05, 2015 1:34 am

I have 10 different balls all randomly moving around on the screen.

I would like to display the name of a ball (from an array, hopefully, but I'm not sure how to read in array and do that either) and have the user click on the ball whose name is displayed. Then, I need to evaluate the mouse click - did the user click the right ball (give a success sound and blow up the ball) or not (bad sound).

Right now all the balls are instances of one graphic. I can't see how I can evaluate the mouse click to determine whether or not the user has clicked the right ball. The mouse click event only accepts the graphic 'ball', not the instances. I know I can add a custom variable to each ball instance, but I don't see how (with the mouse click) to evaluate whether it is the right one that has been clicked or not. This is probably fairly easy to do (once you know how!).

Any tips on how to do this?

Thanks
Ron
B
6
S
2
Posts: 33
Reputation: 512

Post » Sun Jul 05, 2015 8:14 am

-instance variable "name"
-global variable "varName"
compare :"name"="varName".......

example.capx
B
67
S
24
G
7
Posts: 1,518
Reputation: 11,072

Post » Thu Jul 09, 2015 4:42 am

Thanks korbaach!
B
6
S
2
Posts: 33
Reputation: 512


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 1 guest