Touch Controls

Get help using Construct 2

Post » Mon Mar 18, 2013 12:10 pm

Hey all,

I'm trying to do a Touch Controls test. So what I've done is create direction objects to act as my on screen controller. I have Left arrow, Right arrow, and an Up arrow. They are each separate objects. I have a main character which has Platform behavior.

My problem is I can't get the character to move once I turned off default controls. And yes touch is set to use mouse input. My code looks like this: When Touch is pressed on Left arrow character simulate 8 directional movement Left. My character doesn't move at all.

My touch controls are setup on a different layer from the main game.
B
9
S
2
G
3
Posts: 49
Reputation: 2,155

Post » Mon Mar 18, 2013 3:17 pm

It would be helpful if you could share the capx. The logic you described is sound in theory. So without actually seeing what's happening it seems more like guess work to solve your problem.

However the tutorials may already have a solution that is being over looked

Ashley's tutorial

PS.
no wait. you can't mix movement behaviours without finite control. you can't use 8 Way control to use on Platform behaviour.

Platform has it's simulte control, using 8way will not work on the platform behaviour. Don't mix them. Good luckjayderyu2013-03-18 15:19:11
B
87
S
18
G
9
Posts: 2,455
Reputation: 14,834

Post » Mon Mar 18, 2013 3:28 pm

I tried it the other way too without the 8 way control and it still didn't move my object.
B
9
S
2
G
3
Posts: 49
Reputation: 2,155

Post » Mon Mar 18, 2013 3:29 pm

You still haven't posted your capx then :P
B
87
S
18
G
9
Posts: 2,455
Reputation: 14,834

Post » Mon Mar 18, 2013 3:32 pm

Can't right now I'm at work :) Basically I created some direction arrows and I told it when my cursor touches the arrow to move or simulate movement in that direction. I made sure mouse touches were set to Yes.
B
9
S
2
G
3
Posts: 49
Reputation: 2,155

Post » Mon Mar 18, 2013 3:41 pm

Well, if you removed the 8Way directional control. Your
IsTouching ArrowSpriteRight
-> Player - Platform Section - Simulate Control "Right"

and it's still not working. Then it sounds like your touch event is not firing.
B
87
S
18
G
9
Posts: 2,455
Reputation: 14,834

Post » Mon Mar 18, 2013 3:44 pm

That could be the problem....nothing was firing yesterday lol
B
9
S
2
G
3
Posts: 49
Reputation: 2,155

Post » Mon Mar 18, 2013 9:07 pm

Alright....how do I upload my file?
B
9
S
2
G
3
Posts: 49
Reputation: 2,155

Post » Mon Mar 18, 2013 9:37 pm

Well, playing with it I solved it...somehow the event sheet got deselected so no matter what I did the game didn't know what to do.
B
9
S
2
G
3
Posts: 49
Reputation: 2,155

Post » Tue Mar 19, 2013 8:10 am

In the future I would advise you to use Chrome Console plugin you can add events in your code flow to make sure it's being called, also debug variables which is SOOOOO helpful!
B
24
S
11
G
5
Posts: 140
Reputation: 5,004

Next

Return to How do I....?

Who is online

Users browsing this forum: Governador, RookieDev, tarek2, Thelegendvinny and 18 guests