Event on click on an object

Hi,
I just discovered GameDevelop and tried to do some simple things. For example, I wanted to create an event that triggers when the player clicks on a certain object. As this is very basic, I guess theres an easy way to do it, but I couldn’t find it. Is there a place where one can look simple things like this up? The wiki and documentation weren’t particularly helpful.

Another, more general question: I wanted to create a boardgame, similar to checkers, for play against the AI. In order to do this, I need some sort of evaluation of a position, that is, a function that looks at a scene, and counts and checks positions of certain objects and then does some calculations with the result. Is this possible with GameDevelop, or am I on the wrong track?

Sorry if answers to those questions can be found somewhere, but I searched and didn’t find them…

Hi,

To test if the player clicks on an object, you have to use 2 conditions : one checking if the left mouse button is down (“Mouse” category) and the other testing if the mouse is over the object (“All objects” or “Sprite” category).

1 Like

I’ve added an example called “Buttons” in the latest version: Just download the latest version of Game Develop and open it :slight_smile:
I’ve also added an article on the wiki so that it will be shown when one will be searching for information about how to create a button : compilgames.net/wiki/doku.php/en … ingbuttons

1 Like