How do I create an object with a particular animation?

Get help using Construct 2

Post » Tue Nov 17, 2015 1:30 pm

Hi guys! :)

Context: there's a white ball, if you click it, it becomes a black ball (change its animation). Black balls can't touch white balls. I want black balls to spawn little black ball that travels in a random direction.

Do you know how can i command something to create an object but with a different animation instead of its initial animation?

I just want to know if this is possible!

Thanks ;)
B
7
S
1
Posts: 16
Reputation: 464

Post » Tue Nov 17, 2015 2:04 pm

Simply attach an action to the event where you create the object:

event with conditions
> create object ball
> ball set animation
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Nov 17, 2015 2:21 pm

That doesn't work, perhaps i didn't explain the context well but doing that will make the black ball touch a white ball in t=0 which makes you lose the game. Any other suggestions? :s
B
7
S
1
Posts: 16
Reputation: 464

Post » Tue Nov 17, 2015 2:35 pm

I don't understand..
You want the black ball to spawn little black balls, where did the white one come from?
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Nov 17, 2015 2:40 pm

@LittleStain you only get a black ball this way: "there's a white ball, if you click it, it becomes a black ball (change its animation)". You can't just create it, you have first to create the white one
B
7
S
1
Posts: 16
Reputation: 464

Post » Tue Nov 17, 2015 2:56 pm

If you change the animation in the creation event (so before the event is called to destroy when overlapping/colliding) there shouldn't be an issue..
But I might still not understand?
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Nov 17, 2015 3:47 pm

Nevermind, but thanks for trying to help me once again littlestain :)
B
7
S
1
Posts: 16
Reputation: 464

Post » Tue Nov 17, 2015 3:58 pm

Jessica Q wrote:Nevermind, but thanks for trying to help me once again littlestain :)


If you could share a capx to show your issue, it would be much easier to help..
Could be you are misunderstanding my answer, could be I'm misunderstanding your question, could be you are asking the wrong question, I'm not sure..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Nov 17, 2015 9:22 pm

I figured how to solve my problem! I decided to make a whie ball and a black ball two different objects and it worked fine!

To answer my question, as far as I'm concerned: No, it is not possible to make an object spawn with animation Y at t=0 (moment of spawn) if animation X is set as the initial animation. Hoewever in most cases what LittleStain said works just fine!
B
7
S
1
Posts: 16
Reputation: 464

Post » Tue Nov 17, 2015 9:53 pm

Sorry that I still don't understand, but if you couldn't set animation at t=0, the sprites in this example would be destroyed, right?

t=0 example

As far as I know only the "on created" event, which is called before anything can affect the sprite (which is why it's called on created), can affect a sprite earlier..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 20 guests