angle checking nightmare

Get help using Construct 2

Post » Sun Nov 11, 2012 5:33 pm

Hi All,

I am trying to create a shape matching game. I am having trouble checking to see if the selected shapes match the holes they correspond with. I seem to be able to check if the shapes are the same but I am having difficulty checking whether the angles of the holes and shapes are the same. I initially used the within x degrees expression but it didn't work. Im now using the anglediff expression to make a comparison. Unfortunately I havent had much luck getting this to work either.

I would really appreciate any help anyone can give me. I have been trying to fix this for a while now and I dont know where I am going wrong.

https://dl.dropbox.com/u/101200636/Shapematch-updated-v2.capx
B
18
S
4
G
2
Posts: 77
Reputation: 1,588

Post » Sun Nov 11, 2012 5:54 pm

Unfortunately, your capx is a bit complex for someone to look at and quickly find the solution. If you could create a new project which includes just this one issue, we'd be able to assist much more effectively.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Sun Nov 11, 2012 6:57 pm

Hi @sqiddster

Thanks for your reply. I had already slimmed the capx down before posting it on the forum. I tried to leave anything in that I thought was essential in order for the game to work properly because I wanted to make sure anyone viewing it would understand it properly.

At the start of the game 2 target shapes (holes) are put onto the screen at random angles. The player must then chose the correct shapes to put on the screen and rotate them to the correct angles.

The particular section I'm having trouble with is the group called 'Correct'. In this group I check the shapes to make sure they match the holes on the screen (I do this by checking the frames in the animations). I also check the shape to match the height of the target shapes they are going in.

Both of these checks seem to be working, the problems start when I try to check to shapes angles.
B
18
S
4
G
2
Posts: 77
Reputation: 1,588

Post » Sun Nov 11, 2012 7:19 pm

The problem may lie in the fact that some of the shapes are symmetrical - i.e. there is more than one angle it can be at where it can actually fit in the hole.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Mon Nov 12, 2012 9:41 am

@sqiddster, thanks for your suggestion. I don't think this is the problem though, as the angle check still does not work, even when I only use non symmetrical shapes. I'll keep trying other things and hope I come across the solution, thanks anyway.

unplugged
B
18
S
4
G
2
Posts: 77
Reputation: 1,588


Return to How do I....?

Who is online

Users browsing this forum: Vallar and 18 guests