How do I set Object degrees 0 to 270 loop?

Get help using Construct 2

Post » Mon Sep 19, 2016 7:04 pm

hello guys

im trying to make one object (120,20)size When press (space is down ) start Degrees 1 rotate counter - clockwise from 0 to 270 and when object is 270 rotate clockwise (270 to 0) over and over..

Space is up = Stop rotate.

object Origin: X=0 Y=125
B
17
S
7
G
7
Posts: 205
Reputation: 5,335

Post » Mon Sep 19, 2016 10:02 pm

maybe:

global number rotateDir = 1
global number ang = 0

space is down
--- add 100*rotateDir*dt to ang
--- sprite: set angle to ang

ang>270
--- set rotateDir to -1

ang<0
--- set rotateDir to 1
B
94
S
33
G
113
Posts: 5,356
Reputation: 73,273

Post » Tue Sep 20, 2016 1:50 am

actually the 90° is 270 in C2 when Origin x=0 y=125

Image

https://drive.google.com/file/d/0B8mc-_g50xBlT0lfMUxJVnJMdUU/view?usp=sharing

so.. i need when space is pressed spriteAngel start angle 0° to 90° "(270) on c2" and when SprteAngel =90°(270)
go back to 90°(270) to 0°

"btw how can i post image on post so people dont need to click the url link"?
B
17
S
7
G
7
Posts: 205
Reputation: 5,335

Post » Tue Sep 20, 2016 2:05 am

CBelle wrote:actually the 90° is 270 in C2 when Origin x=0 y=125

Image

https://drive.google.com/file/d/0B8mc-_g50xBlT0lfMUxJVnJMdUU/view?usp=sharing

so.. i need when space is pressed spriteAngel start angle 0° to 90° "(270) on c2" and when SprteAngel =90°(270)
go back to 90°(270) to 0°

"btw how can i post image on post so people dont need to click the url link"?


Use http://imgur.com. :mrgreen:

After you post the imgur's URL on your post, use the IMG tag to show the image.
B
11
S
6
G
15
Posts: 256
Reputation: 9,207

Post » Tue Sep 20, 2016 4:01 am

Angles in c2 and most places in graphics are clockwise from the right. Anyway the idea is the same, just change the values. Just change 270 to 90 and ang to -ang.
B
94
S
33
G
113
Posts: 5,356
Reputation: 73,273


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 48 guests