# How do I set Object degrees 0 to 270 loop?

Get help using Construct 2

### » 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

### » Mon Sep 19, 2016 10:02 pm

maybe:

global number rotateDir = 1
global number ang = 0

space is down
--- sprite: set angle to ang

ang>270
--- set rotateDir to -1

ang<0
--- set rotateDir to 1
B
101
S
39
G
134
Posts: 5,591
Reputation: 85,520

### » Tue Sep 20, 2016 1:50 am

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

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

### » Tue Sep 20, 2016 2:05 am

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

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.

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

### » 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
101
S
39
G
134
Posts: 5,591
Reputation: 85,520