How do I create different sprite every 60 seconds

Get help using Construct 2

Post » Mon Aug 18, 2014 3:23 pm

Hello,

I have looked in a forum but couldn't find it. How do I create different sprites every 60 seconds, I have a scrolling game and I will to use them as power ups, there will be 6 different ones. I want them to appear in order I want using create an object or something.

Thanks,

Aurimas
B
8
S
2
Posts: 25
Reputation: 552

Post » Mon Aug 18, 2014 4:52 pm

You don't need different sprites for every power-up. You can use only one sprite named powerup and make the different power-ups different animations (first power-up should be with animation name of powerup0). Then it's easy to do what you want:
First thing first, create a global variable named powerupnumber (set initial value to 0). Then:
System -> Every 60 seconds:
- System -> Create object -> powerup (set X and Y)
- powerup -> Set Animation -> "powerup" & powerupnumber
- System -> Set value -> powerupnumber to (powerupnumber+1)%6

Let me know if you get stuck again :D
B
9
S
1
Posts: 33
Reputation: 596

Post » Mon Aug 18, 2014 9:47 pm

Check the tutorials/samples.
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Mon Aug 18, 2014 10:02 pm

I think I am stupid, it is not working for me, please see attached how I have done it with two different setups
You do not have the required permissions to view the files attached to this post.
B
8
S
2
Posts: 25
Reputation: 552

Post » Mon Aug 18, 2014 11:47 pm

Pretty sure you're not stupid :) Can you post the capx? We could help you more.
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Tue Aug 19, 2014 12:21 am

See if this helps. It's pretty rudimentary but still.. This is based on different objects rather than one object/multiple animations. It's based on the autorunner template.
You do not have the required permissions to view the files attached to this post.
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Tue Aug 19, 2014 10:32 am

Aurimas wrote:I think I am stupid, it is not working for me, please see attached how I have done it with two different setups


In your photos, you create object powerup0 & powerubnumber that means that you'll create objects like powerup00, powerup01, powerup02, ...., and that's not what you want, you want only powerup & powerupnumber so it'll be powerup0, powerup1, powerup2, ... the only thing is that the initial value of powerupnumber should be 0. Then, you have to set it's value to (powerupnumber+1)%(how many animations do you have), so in your pictures should be 3.

If you still have any problems, post your .capx please :D

L. Edit: Only the setup where you have 3 different animations is good. The other one where you have 3 different frames isn't going to work.
B
9
S
1
Posts: 33
Reputation: 596

Post » Tue Aug 19, 2014 3:03 pm

I had some joy with codah example and it would be perfect for me, but I can't control with member from a family appears and that would be a problem for power up (I want to have an option to cancel all power up), and I still don't have a joy on animation one. please see capx
You do not have the required permissions to view the files attached to this post.
B
8
S
2
Posts: 25
Reputation: 552

Post » Tue Aug 19, 2014 6:53 pm

Told you. Change the "powerup0" to "powerup". Check this .capx, is the exact same thing that you sent, just that little modification. But that thing with the families is cool too, I'm new and didn't knew that :D
You do not have the required permissions to view the files attached to this post.
B
9
S
1
Posts: 33
Reputation: 596

Post » Tue Aug 19, 2014 7:26 pm

I tough I have tried to do it (removing 0) and it didn't work :oops: , it works fine just one small question how do you assign option: if object overlaps animation0 do this but then it overlaps different animation outcome is different. I can't see it in create object menu, new to this method
B
8
S
2
Posts: 25
Reputation: 552

Next

Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, wertt22 and 32 guests