solid blocks

Get help using Construct 2

Post » Tue Nov 05, 2013 8:14 am

Hi guys,
Challenge is:
pull by finger (on mobile) red block into space between blue blocks,
i don't know what to do with physics to make blocks solid and don't fall down.
Please, can somebody help me with that

https://www.dropbox.com/s/uggxiynvgxwlw73/blocks.capx
Image
B
14
S
6
G
5
Posts: 99
Reputation: 3,825

Post » Tue Nov 05, 2013 9:44 am

how to implement it on pc with mouse?
pull by mouse red block into space between blue blocks.
Image
B
14
S
6
G
5
Posts: 99
Reputation: 3,825

Post » Tue Nov 05, 2013 10:45 am

Sorry for my lame english
i want to simplify my question:
how to make blocks movable by mouse, but blocks must me solid (not go thru each other)?
Please help me
https://www.dropbox.com/s/uggxiynvgxwlw73/blocks.capx
Image
B
14
S
6
G
5
Posts: 99
Reputation: 3,825

Post » Tue Nov 05, 2013 10:53 am

First, you dont have to use so many different sprites, it's much better to use instances of the same object.

Second, add a movement behaviour to the red Sprite.

Third, use on collision or is overlapping conditions on the black sprite(s) or set it (them) to solid and use a behaviour for the red sprite than interacts with solid behaviour.
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 05, 2013 11:33 am

I need different sprites cus they will be with different pictures.(instances becaming looks alike).
I made changes that you suggest. but something wrong i guess.
actually i need every block movable and solid(not only red)
here is capx
https://www.dropbox.com/s/uggxiynvgxwlw73/blocks.capx
Image
B
14
S
6
G
5
Posts: 99
Reputation: 3,825

Post » Tue Nov 05, 2013 11:49 am

Instead of using different sprites, you could use different animationframes.

I opened your capx, but there are only two events, which are also quite useless. Your black sprites all have different or no behaviours at all.

When I look at the capx You provided it looks like you haven't tried to improve it or just don't know how to work with Construct 2.

Do you understand how behaviours, events, variables, conditions, subevents and actions work within Construct 2? If not I would recommend following the beginners-tutorials in the tutorial section, so you get a better feel as to how to work with Construct 2.
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 05, 2013 12:22 pm

changes i made is:
1 CustomMovement to red block - yes block moving with mouse
2 i made nearby few bloks Solid - red block not feeling it
Yes i'm newbie so i don't now whitch events useless or worthwhile.
I understand in bare outlines about behaviours, events, variables, conditions, but not pro for sure.
I red beginners-tutorials and still have the same quastion how to make it
Image
B
14
S
6
G
5
Posts: 99
Reputation: 3,825

Post » Tue Nov 05, 2013 12:53 pm

Found this for you in the FAQ-thread:

Drag and drop avoid overlapping
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 » Wed Nov 06, 2013 6:19 am

Thank you LittleStain!
Since this method using many instances of the "move" object.
I think i need to make each instances looks different with this string:

System - On start of layout - move - Set animation frame to 1
but this will change every instance.
So i suppose i have to use UID to set different frame to different instance
i don't know how to write it into my string.

And one more thing how make them move by one block pace, in other word when i pull any block, it moves block by block not pixel by pixel ?

https://www.dropbox.com/s/b5a9mhti11je64d/drag_drop.capx
Image
B
14
S
6
G
5
Posts: 99
Reputation: 3,825


Return to How do I....?

Who is online

Users browsing this forum: dop2000 and 14 guests