Place the picture in order Game

Get help using Construct 2

Post » Thu Oct 24, 2013 8:28 pm

damn timeout, lost my post ...

anyway:

create variables for the sprites
"start_X", "start_Y",
then, make an action "if there are more than 2 correct sprites on spot A"
return bottom sprite to start_X, start_Y
you could also create a third variable "am I on bottom?"
to let the sprite know if it will be the one returning to starting spot.ghost2013-10-24 20:29:05
B
12
S
3
G
1
Posts: 347
Reputation: 2,866

Post » Thu Oct 24, 2013 10:32 pm

@NECROKRIEG

Sorry couldn't open Capx - u r using v148, i just tried downloading the beta and my anti-virus is kicking it out :-(

So without seeing the Capx I'm kinda shooting in the dark - out of interest are u using families. I got round the problem u describe by having the card, and then the same card in a family. U can then detect event where card is touching card family and create actions against each one (so card snaps to new position, card family returns to original place).

I will have a better look when i have sorted the antivirus thing out
B
8
S
2
G
1
Posts: 45
Reputation: 1,007

Post » Mon Oct 28, 2013 10:35 pm

Thanks @sainsy @ghost @plinkie @Dutoit

I worked it out! :D
The cards now don't stick under each other when they overlap. I lerped the green card so it smoothly snaps back when you let go. Take a look, it might be of some use. It feels good

Capx

I was wondering whether anyone knows how to make a grid in a way you can overlap cards (as if they have been dealt out)



I don't want the cards to cover up each other if they are in the same slot. I tried overlapping the grid but the cards don't follow suit. (excuse the pun)
NECROKRIEG2013-10-28 22:35:53
B
15
S
6
G
3
Posts: 87
Reputation: 4,304

Post » Mon Oct 28, 2013 11:23 pm

maybe using z-order, i think there's already a capx on the arcade about this.
B
12
S
3
G
1
Posts: 347
Reputation: 2,866

Post » Tue Oct 29, 2013 6:28 am

I haven't installed latest beta, but agree with ghost, z-order is probably best latest card being on topDUTOIT2013-10-29 06:33:29
You think you can do these things, but you can't, Nemo!
Just keep reading.
Just keep learning.
B
65
S
16
G
9
Posts: 1,429
Reputation: 12,718

Post » Mon Nov 04, 2013 10:11 am

Great stuff guys, thanks for pointing me in the right direction!

Z Order CapxNECROKRIEG2013-11-04 10:47:05
B
15
S
6
G
3
Posts: 87
Reputation: 4,304

Post » Mon Nov 04, 2013 6:16 pm

Hi @plinkie
I'm really stuck on how to make an 'empty' slot.
I basically want the player to put a Blue card in a slot. Once the card fills that slot to '1' no more cards can be placed there. If a second card is placed on top of that 'full' slot the card should automatically snap to an empty slot. How can I pick an empty slot instance? I tried comparing an instance variable to pick any slot below 1 (empty) but it glitches. :)

Capx
B
15
S
6
G
3
Posts: 87
Reputation: 4,304

Post » Mon Nov 04, 2013 11:43 pm

@NECROKRIEG
I have created the following functionality. Hopefully this is helpful, I thought this would work better than choosing a random empty slot. If you definitely want it to choose the nearest empty slot then I can help set up some logic but it's late now : P

- On drop, card goes to a slot if overlapping
   - if slot is full then card will go to original starting position
   - if slot is empty then card will be placed in slot

capxplinkie2013-11-04 23:55:47
B
47
S
17
G
82
Posts: 2,231
Reputation: 48,609

Post » Tue Nov 05, 2013 9:49 am

@NECROKRIEG

Please review my earlier Capx - it does exactly this
B
8
S
2
G
1
Posts: 45
Reputation: 1,007

Post » Tue Nov 05, 2013 7:11 pm

@sainsy Oh yes, thanks. I reviewed it again. Im going to keep it simple. I'll go through Kittiewan's tutorial once more.

@plinkie, thanks that's almost what I was trying to achieve. Im going to stick to this logic. But there's Just one bug bear; sometimes the empty slot repels a card. It's an intermittent problem happening roughly 1 in 4 goes (I refresh game after a go), other times all cards snap in place.

Iv also learnt how to make a menu slide in like an Angry Birds win screen if you need it, its in this Capx
B
15
S
6
G
3
Posts: 87
Reputation: 4,304

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: tarek2 and 17 guests