How do I

Get help using Construct 2

Post » Sat Mar 11, 2017 2:35 pm

hello
i have sprite and cloned it to 5 more
how do i make each copy show a frame differ from each of the rest 5
and how do i make just one of them show same like another randomly

its flash card match game
thanks in advance
B
22
S
8
G
2
Posts: 77
Reputation: 2,701

Post » Sat Mar 11, 2017 5:50 pm

cloned or copied?
B
13
S
7
G
4
Posts: 429
Reputation: 4,184

Post » Sat Mar 11, 2017 6:12 pm

@NN81
i pressed ctrl so is there is a difference ?
B
22
S
8
G
2
Posts: 77
Reputation: 2,701

Post » Sat Mar 11, 2017 6:25 pm

yes is it different CTRL do a simple copy of the same object but NOT make a indipendent one, clone command, however, make a NEW indipendent object identical at the original.
B
13
S
7
G
4
Posts: 429
Reputation: 4,184

Post » Sat Mar 11, 2017 7:04 pm

@NN81 i almost understood the concept but still dont know how to make what i asked for :) ?
B
22
S
8
G
2
Posts: 77
Reputation: 2,701

Post » Sat Mar 11, 2017 7:34 pm

semaso wrote:@NN81 i almost understood the concept but still dont know how to make what i asked for :) ?

If clones instead of copying them, you will be able to manage them in the events sheet regardless of one by one. in your particular you may have to resort to random variables values i think :roll:
B
13
S
7
G
4
Posts: 429
Reputation: 4,184

Post » Sat Mar 11, 2017 7:58 pm

@NN81 i'll try my best thanks
B
22
S
8
G
2
Posts: 77
Reputation: 2,701


Post » Mon Mar 13, 2017 6:30 pm

@Lordshiva1948 thank you i will try to understand it :)
B
22
S
8
G
2
Posts: 77
Reputation: 2,701

Post » Mon Mar 13, 2017 7:22 pm

Are you sure you cloned them and not copied them?

If they are clones they will each have a unique name or number like sprite1, sprite2, etc.

In your events you can set each one to a different animation using that name.

Set Sprite1 animation "Hearts"

If you want them to show a random card animation then you need a variable to determine which card is shown.

Global variable RandomCard=0

On key press: Set RandomCard = random(1,11)

On RandomCard =1: Set Card1 to animation "Hearts"

and so on for the rest of the cards.
Banned User
B
28
S
7
G
58
Posts: 1,229
Reputation: 34,825

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 46 guests