compare x and frame

Get help using Construct 2

Post » Wed Nov 13, 2013 2:11 pm

how i know when two box adjacent and have same frame ?? i want it become blank when adjacent ..

capx

sorry for my bad english ..
B
12
S
2
G
2
Posts: 54
Reputation: 2,144

Post » Wed Nov 13, 2013 2:20 pm

do you mean the two boxes or two bricks ?

and which neighbors you want to check ?
- horizontal?
- vertical?
- diagonal?Petres2013-11-13 14:43:41
B
7
S
3
Posts: 15
Reputation: 1,455

Post » Wed Nov 13, 2013 6:47 pm

box is overlapping box at offset - 32, 0
(sub event)
box animation frame = box.animation frame
do action

this checks the box next to it 32 units to the left
then compares the box's current frame to the one next to it

if they are the same, then it will perform the action you want.
B
87
S
44
G
16
Posts: 1,002
Reputation: 17,932

Post » Thu Nov 14, 2013 3:42 am

@Petres
Like this , i want to know when it adjacent , score will be added .
Two brick in two box ..
box just use for rotating the brick ..


@justifun
sorry i don't get it what you mean .. bhentz2013-11-14 03:44:48
B
12
S
2
G
2
Posts: 54
Reputation: 2,144

Post » Thu Nov 14, 2013 10:11 am

@bhentz

If you want to work with your actual algorithm:

+ On touch box
++ brick is overlapping box
++ for each brick
+++ justifuns stuff + checking all 4 arround

If you want to do it better you should make a 2 dimensional array, insert into it for each field a number from 1-4 to identify the colors.

If you rotate than a box you just have to rotate it and set the array informations right. This would make it much easier to build all functions that you will need ;)
B
15
S
6
G
6
Posts: 512
Reputation: 5,555

Post » Thu Nov 14, 2013 12:03 pm

@Darklinki can explain with capx .. it's hard to understand from it .
B
12
S
2
G
2
Posts: 54
Reputation: 2,144

Post » Fri Nov 15, 2013 5:17 am

any idea ?? i have'nt get it
B
12
S
2
G
2
Posts: 54
Reputation: 2,144


Return to How do I....?

Who is online

Users browsing this forum: amazingdream, Yahoo [Bot] and 19 guests