Help on rotation of layer

Get help using Construct 2

Post » Mon May 13, 2013 7:57 pm

For some reason i cant reply on my last topic...

this is what i have so far:

https://www.dropbox.com/s/jnp0yve9gh1mnqb/LayerRotation.jpg

And it works on left arrow (but only one full circle and i woild like it to continue indefenetly)
But on right arrow stops aftre first click and thats it... no more movement.

Is there any kind soul to help me out on this?

Thank You!!!
B
26
S
11
G
2
Posts: 669
Reputation: 5,038

Post » Mon May 13, 2013 8:53 pm

Hi @irina
Why did you add the event condition : LayerAngle(0) = rotAngle ?


B
14
S
4
G
2
Posts: 190
Reputation: 3,938

Post » Mon May 13, 2013 8:54 pm

1.- put the two keyboard events at root (not inside System Layerangle rot angle)
2.- Make the +45 angle activate group "ROTATE 45 RIGHT"
3.- Inside the group on a blank event put the action "add +45 to sprite"
4.- Inside the group on a second blank event put action: Deactivate "ROTATE 45 RIGHT" group.
do the same for rotate -45

hope that helps
B
18
S
5
G
4
Posts: 568
Reputation: 5,079

Post » Mon May 13, 2013 8:55 pm

damn, even easier,
EVENT: on keyboard press Right ACTION: set angle layer.angle +45

or
Global Variable: varLayerAngle = 0
EVENT: on keyboard press Right
ACTION1: add to varLayerAngle +45
ACTION2: set layer.angle = layer.angle + varLayerAngleCalifornia2013-05-13 20:58:17
B
18
S
5
G
4
Posts: 568
Reputation: 5,079

Post » Mon May 13, 2013 9:15 pm

@ beufreecasse

i was trying that in order to avoid on double key tap to rotate 90 at once.

I want it to rotate step by step. Untill first rotation step is not finished next one shud not begin.

Is there any other way to produce that?


irina2013-05-13 21:24:22
B
26
S
11
G
2
Posts: 669
Reputation: 5,038

Post » Mon May 13, 2013 9:31 pm

@ California

Both of those sugestions produce instant rotation and not nice scrolling... :(
B
26
S
11
G
2
Posts: 669
Reputation: 5,038

Post » Mon May 13, 2013 10:05 pm

@irina

It works pretty well with that :
beufreecasse2013-05-13 22:08:21
B
14
S
4
G
2
Posts: 190
Reputation: 3,938

Post » Mon May 13, 2013 10:07 pm

Yes ... but on double tap it rotates 45+45 at once... thats whats bothering me. :(
B
26
S
11
G
2
Posts: 669
Reputation: 5,038

Post » Mon May 13, 2013 10:17 pm

@irina

Ok try this :
B
14
S
4
G
2
Posts: 190
Reputation: 3,938

Post » Mon May 13, 2013 11:04 pm

Ok, it rotates a bit longer (full 360) but still it has end and it wont rotate permanently... :(
B
26
S
11
G
2
Posts: 669
Reputation: 5,038

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 4 guests