Date's Adventure Touch Control

Get help using Construct 2

Post » Tue Feb 14, 2012 9:36 am

@Kyatric Thanks 4 ur help.
I tried to use the is touching object 4 the right and left directions and it works fine.
For the top direction i just left it as it is "on touch object" but i want it to work as it is in the game now; ie:
if he is standing and jump the strength of the jump will be different from the case of he is running and jump. and in both cases there is two jumps one if he is in the floor and the other if he is on the sky.

Thanks again and wish u a nice day :)
B
303
S
6
G
5
Posts: 163
Reputation: 12,152

Post » Tue Feb 14, 2012 9:38 am

@SoldjahBoy Thanks and sure it helps :)
B
303
S
6
G
5
Posts: 163
Reputation: 12,152

Post » Tue Feb 14, 2012 10:05 am

@Kyatric I also want the platform behavior to work not just adding or subtracting 5. like when i press the right arrow the player running animation will start to work, when i press the top arrow the jump and fall animation will work also and the same thing with the down arrow and sitting animation.

So is that possible?

Thankssss
B
303
S
6
G
5
Posts: 163
Reputation: 12,152

Post » Tue Feb 14, 2012 10:07 am

Yes, you can have anything happen upon release. The only bit you need to take away from my example are the buttons.

[ is touching >> run animation

is != touching >> set default animation

]

etc. Khaz2012-02-14 10:08:52
B
11
S
3
G
2
Posts: 110
Reputation: 2,410

Post » Tue Feb 14, 2012 10:24 am

That's what i did it works fine for the Right, left and the normal jump, but it's not working for the down and double jump.
mina2012-02-14 10:26:16
B
303
S
6
G
5
Posts: 163
Reputation: 12,152

Post » Tue Feb 14, 2012 10:36 am

Thanks everybody, I did the jumps different strength and working on the sitting.
B
303
S
6
G
5
Posts: 163
Reputation: 12,152

Post » Tue Feb 14, 2012 10:55 am

The sitting animation is working but taking only the first frame from the 5 sitting frames!!!
B
303
S
6
G
5
Posts: 163
Reputation: 12,152

Post » Tue Feb 14, 2012 11:21 am

Mina, I was looking for it these days and saw a very improved solution.

The game designer did 4 semi transparent images, placed them covering all the screen, like slicing the screen in 4 parts. This images are all On Top, so, when you touch your screen, you're touching the buttons.

Figuring out how to use the buttons:
> When Touch Screen for Right, simulate control for Right.

The sitting animation need a complex mechanic behind it, so, I'll try to teach you the basic behind this logic. (My sandBOX is a good start to learn complex movements)

Always you create something different from the "Standing" animation, where you player is not pressing any key, you'll need to setup variables to detect these different poses.

Always you have two different poses for the same function, like stand sitting and stand up, you need to setup a variable (like >pose) to make the code know when your gadget is sitting or standing up.

When sitting down, change >pose = "sitting", and make the standing up check if >pose = "standing", so, when different from standing, the code will meet the requisites and will not freeze your animation for sitting down.
The same work when you release (or "not keyDown") the "down" key, setting >pose = "standing", and doing a conditional check for sitting, like the last one.

So, you need a start, middle (in action) and finish for every pose you make. I concern you to use variables with "text" and show them on the screen, to see what is happening "in code".

Good luck ^^TELLES08082012-02-14 11:26:18
ImageImageImageImageImageImage
B
93
S
20
G
12
Posts: 1,211
Reputation: 18,473

Previous

Return to How do I....?

Who is online

Users browsing this forum: chcteacher, Televangelist and 24 guests