Detect "W" or "X"

Get help using Construct 2

Post » Tue Mar 20, 2012 8:25 am

I am creating a Tower Blocks style game.

When the Boxes drop, is there a way I can detect if the box is perfectly aligned with the box it drops onto?

I'm assuming it should somehow read the Width or X Alignment of the previous block?Pixiefingers2012-03-20 08:47:16
B
11
S
2
Posts: 127
Reputation: 1,532

Post » Tue Mar 20, 2012 9:20 am

you can compare the X values of both boxes and if they are equal, they are aligned, asuming that both boxes are instances of the same object.

If not, then you have to make sure, that the Imagepoint 0 is set to the same "value" on both sprites
B
42
S
19
G
12
Posts: 723
Reputation: 13,911

Post » Tue Mar 20, 2012 9:36 am

[QUOTE=Weishaupt] you can compare the X values of both boxes and if they are equal, they are aligned, asuming that both boxes are instances of the same object.

If not, then you have to make sure, that the Imagepoint 0 is set to the same "value" on both sprites[/QUOTE]

The boxes are instances of the same object.

Basically all that will happen if they are = to one another is a higher score and a change in animation.

Could you perhaps show me? I'm Still quite new to C2.

I'm guessing it would be attached to:



B
11
S
2
Posts: 127
Reputation: 1,532

Post » Tue Mar 20, 2012 10:13 am

It would be loads easier for both of us, if you could post your CAPX
B
42
S
19
G
12
Posts: 723
Reputation: 13,911

Post » Tue Mar 20, 2012 10:19 am

lol. ok. Will compile one quick.
B
11
S
2
Posts: 127
Reputation: 1,532

Post » Tue Mar 20, 2012 10:31 am

[QUOTE=Weishaupt] It would be loads easier for both of us, if you could post your CAPX[/QUOTE]

Here you go.

Tower Blocks
B
11
S
2
Posts: 127
Reputation: 1,532

Post » Tue Mar 20, 2012 10:35 am

Two things i notice:
- the boxes are very "bouncy". I even did not manage to get ONE on the plattform and at release time the first jump up
- the drop behaviour is not correct, when it comes to physics...

...and now I take a look at the scoring, as you asked
B
42
S
19
G
12
Posts: 723
Reputation: 13,911

Post » Tue Mar 20, 2012 10:36 am

[QUOTE=Weishaupt] Two things i notice:
- the boxes are very "bouncy". I even did not manage to get ONE on the plattform and at release time the first jump up
- the drop behaviour is not correct, when it comes to physics...

...and now I take a look at the scoring, as you asked[/QUOTE]

It is hard, but do-able once you get the hang of it. You are most welcome to assist there if you so wish to do so.

Thank you.
B
11
S
2
Posts: 127
Reputation: 1,532

Post » Tue Mar 20, 2012 10:44 am

imagine how the boxes would drop in real life. as ist is right now, they just drop straight down from the point they are released. in real life the would arch....
B
42
S
19
G
12
Posts: 723
Reputation: 13,911

Post » Tue Mar 20, 2012 10:45 am

Updated with more usable version

http://dl.dropbox.com/u/67025590/C2/TowerHelp.capxPixiefingers2012-03-20 10:46:08
B
11
S
2
Posts: 127
Reputation: 1,532

Next

Return to How do I....?

Who is online

Users browsing this forum: flemmig, semaso, Skebab, Virpoja and 13 guests