how do I control drag and drop like this example

Get help using Construct 2

Post » Tue Mar 18, 2014 1:34 am

Hi all :)
Im wondering if someone might be able to tell me if this is posible in Construct 2 .
Think in terms of a tower defence type map.
As per picture the players avatar starts off life as in the pictures "normal state", when the player goes to move
their avatar a ring is shown around the avatar when the mouse is over it.
(this is not dificult, you just use animation and mouse over effect I assume.)
The ring indicates the available area the player can move their avatar.

Now the bit Im trying to work out :)
The player then left clicks on the avatar and can drag and drop the avatar anywhere within the circle and place it where they want.

In the game they can repeat this so the avatar can move around the map but only in steps within the area of the circle...if that makes sence.

Any ideas on what events I should be researching to get this outcome?
Sorry about bodgy pic, Im at work and had to use mspaint :)

Cheers
thren
You do not have the required permissions to view the files attached to this post.
B
13
S
3
G
1
Posts: 25
Reputation: 1,176

Post » Tue Mar 18, 2014 1:46 am

I do have a question for you, will the circle always be there if you mouse over the avatar? If so, I would just make a mouse over event that makes the circle visible. Of course the circle is pinned to the avatar.

Did that answer your question, kind of a little lost on what else you wanted to work out.
B
19
S
7
G
7
Posts: 88
Reputation: 4,102

Post » Tue Mar 18, 2014 2:18 am

Yes the circle will allways be there if you mouse over it.

Constraining the drag and drop to inside the circle and not having the circle move during the drag and drop is the bit doing my head in atm :)
B
13
S
3
G
1
Posts: 25
Reputation: 1,176

Post » Tue Mar 18, 2014 2:36 am

Oh sorry, I get it now.

Well, easy to fix, on the mouseover event you see the circle which could always be there invisible, on the mouse down event you would have that circle disappear and another just like it appear at those coordinates and restrain movement of that player to those coordinates. That's the first way that comes to my mind, sure there are others. Need something more?
B
19
S
7
G
7
Posts: 88
Reputation: 4,102

Post » Tue Mar 18, 2014 6:21 am

Im home from work, here is a capx file. (made in latest beta)

What I want to do is:
1: keep drag and drop inside the circle that appears.
2: when you go to drag and drop again, the circle is re-centered on the "canons" new location
and you can only drag and drop within the new circles location.

if that makes sense...
I'll continue working on a solution now Im home from work.
Im thinking I need to create a family of both images and see if I can join them both with different behaviors...
You do not have the required permissions to view the files attached to this post.
B
13
S
3
G
1
Posts: 25
Reputation: 1,176

Post » Tue Mar 18, 2014 7:56 am

my first attempt
You do not have the required permissions to view the files attached to this post.
August 2015 - I misplaced a lot of links - I will try to find backups and repost. If You find a post that interests please reply to post with @rampackwobble and I will get a nudge!

If you find my posts useful please consider donating something to a local charity or to the http://www.mndassociation.org/
B
64
S
33
G
47
Posts: 1,194
Reputation: 30,812

Post » Tue Mar 18, 2014 8:06 am

RamPackWobble wrote:my first attempt



Thank you very much, your example does what I need I believe.
Now to study .... thanks for your solution and example.
B
13
S
3
G
1
Posts: 25
Reputation: 1,176


Return to How do I....?

Who is online

Users browsing this forum: stevenode and 8 guests