Touch Help

Get help using Construct 2

Post » Tue Jan 24, 2017 4:46 am

Hey Guys,

So lets say I have a plane and I want it to show it in the up position on the first tap, and the next tap it would be on the lower position.

When I try to set a variable to enable one or the other I can't get it to play nice.

If you have any suggestions or examples it would be greatly appreciated!

Thanks,

~ Chase
Image
B
21
S
6
Posts: 40
Reputation: 1,357

Post » Tue Jan 24, 2017 4:55 am

Make a numeric variable and set it to 0.

Make an event that says on touch (or whatever you want) set variable to 1-variable.

Make another event that says if variable = 0 set plane position to top
else set plane position to bottom
B
60
S
20
G
56
Posts: 1,077
Reputation: 35,941

Post » Tue Jan 24, 2017 11:34 pm

I tried that prior but I think I must be coding it improperly. Thanks for the reply it verifies my theory :)
Image
B
21
S
6
Posts: 40
Reputation: 1,357

Post » Wed Jan 25, 2017 12:04 am

I have

Global Variable PlaneHeight = 1

Touch | On tap gesture | Arrow | Set animation frame to 1
System | PlaneHeight = 0 | System | Set PlaneHeight to 1

Touch | On tap gesture | Arrow | Set animation frame to 0
System | PlaneHeight = 1 | System | Set PlaneHeight to 0

This isn't working, where am I going wrong :/
Image
B
21
S
6
Posts: 40
Reputation: 1,357

Post » Wed Jan 25, 2017 2:20 am

If the image point is the same in both frames the image will change but the sprite will stay at that same X and Y coordinate.

Are you trying to do a flappy bird type game?

If so there is a good flappy bird demo in the C2 demos included with C2.
Banned User
B
23
S
6
G
58
Posts: 1,229
Reputation: 34,540

Post » Thu Jan 26, 2017 1:15 am

no, not another flappy bird game. Basically the image will get bigger then tap again making it smaller. It seems to only work once and then fails.
Image
B
21
S
6
Posts: 40
Reputation: 1,357

Post » Thu Jan 26, 2017 3:24 pm

try using sub event to check variable
B
245
S
39
G
15
Posts: 1,945
Reputation: 40,264

Post » Thu Jan 26, 2017 4:45 pm

I will give that a try, thanks Lord, lol. God Bless, lol.
Image
B
21
S
6
Posts: 40
Reputation: 1,357

Post » Thu Jan 26, 2017 7:13 pm

chimchase may Lord Shiva bless you & your loved ones
B
245
S
39
G
15
Posts: 1,945
Reputation: 40,264

Post » Mon Jan 30, 2017 8:54 pm

I still can't seem to get it, is there somebody that could possibly send / create an example?
Image
B
21
S
6
Posts: 40
Reputation: 1,357

Next

Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go and 6 guests