I need to know how to..

Get help using Construct 2

Post » Tue Jan 29, 2013 10:54 pm

RangerJim got it right.

Picking closest to mouse cursor wouldn't work. What if the animation finishes and the mouse has been moved elsewhere in that time? ;)
B
15
S
5
G
7
Posts: 877
Reputation: 5,650

Post » Wed Jan 30, 2013 6:48 am

@RangerJim @procrastinator Can you tell me how to do that? Cause i really have no idea, but it sounds great!CX052013-01-30 08:17:42
B
5
Posts: 55
Reputation: 585

Post » Wed Jan 30, 2013 8:23 am

Typing Game (r115)

Quickest way of answering you in the short time I have. It's something I wrote for someone else on the forums. It's nothing like what you're doing, but saving the sprite UID and picking a sprite based on that variable is in there, so it may give you some ideas. You know... until someone comes along and answers properly ;p
B
15
S
5
G
7
Posts: 877
Reputation: 5,650

Post » Wed Jan 30, 2013 10:35 am

Can someone please explain what i need to do?
B
5
Posts: 55
Reputation: 585

Post » Wed Jan 30, 2013 10:47 am

[QUOTE=CX05] Can someone please explain what i need to do?[/QUOTE]

You'll need to specify WHICH grass you want to destroy. If you do not PICK any specific grass instance, the actions will be executed on all of them.

Don't really know how you've build your sprites so I cannot give you exact answer. Is breaking separate sprite that is overlaid on grass tiles or is it animation of the grass tile?

You'll need to specify which grass will be destroyed by picking it. I recommend checking the FAQ thread so you'll understand how picking works :)
B
24
S
8
G
7
Posts: 756
Reputation: 7,192

Post » Wed Jan 30, 2013 11:11 am

@vee41 The break animation is a sprite itself, and the grass is a sprite itself. When you click on grass, i set it do do like this: When left clicked on grass, set position to Grass.Y, Grass.X.

It looks like it is pretty advanced.

The funny thing is, that if i do like: When left clicked, destroy grass. - that actually works, it just destroys the one that you click on.. which is that i need, i just need the animation to finish.CX052013-01-30 11:13:27
B
5
Posts: 55
Reputation: 585

Post » Wed Jan 30, 2013 11:27 am

[QUOTE=CX05] @vee41 The break animation is a sprite itself, and the grass is a sprite itself. When you click on grass, i set it do do like this: When left clicked on grass, set position to Grass.Y, Grass.X.

It looks like it is pretty advanced.

The funny thing is, that if i do like: When left clicked, destroy grass. - that actually works, it just destroys the one that you click on.. which is that i need, i just need the animation to finish.[/QUOTE]

Clicking action in itself does pick the grass object as you click directly on the object, it knows you intend to do the action on this specific grass tile. Having animation finish on another sprite has no way of knowing which grass tile you want to destroy.

Add this condition to event where break animation finishes:

Grass Pick Nearest to (BreakSpriteName.X, BreakSpriteName.Y)
B
24
S
8
G
7
Posts: 756
Reputation: 7,192

Post » Wed Jan 30, 2013 12:27 pm

I will try it, thank you :)
B
5
Posts: 55
Reputation: 585

Post » Wed Jan 30, 2013 3:19 pm

@vee41 thank you! it works!
B
5
Posts: 55
Reputation: 585

Post » Sat Apr 13, 2013 4:57 pm

[QUOTE=procrastinator] Typing Game (r115)

Quickest way of answering you in the short time I have. It's something I wrote for someone else on the forums. It's nothing like what you're doing, but saving the sprite UID and picking a sprite based on that variable is in there, so it may give you some ideas. You know... until someone comes along and answers properly ;p[/QUOTE]

Awesome example @procrastinator :)

I will try to understanding the game logic for this.

Thanks for sharing with us
Enlik Tjioe
Game Programmer

Image

www.touchten.com
B
45
S
11
G
6
Posts: 176
Reputation: 7,289

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: Muini, Yahoo [Bot] and 31 guests