Is it possible to rotate an array?

For questions about using Classic.

Post » Sat Jul 30, 2011 10:39 pm

[QUOTE=tulamide] [QUOTE=Arsonide] [QUOTE=newt]Btw I think "S" has a built in function to rotate its arrays as well.[/QUOTE]

I thought something did, but I couldn't remember what. I think it was S.[/QUOTE]

Again, I'm sorry, but this is not quite right. The function indeed is called rotate array, but it shifts a 1-dimensional array to the right or to the left (aka the equivalent to moving, not angular rotation), so

ABCD

rotated by 1 gets

DABC

or rotated by -1 gets

BCDA[/QUOTE]

Ahh well thats ok. Thats the only type of array I can do in S :P

[QUOTE=tulamide]Also, when using any free rotional functions, wether from 's' or just sin/cos, you can't make sure you will always keep all values on the grid (because of the rounding, that needs to be applied), leading to overwriting or doubling values.
[/QUOTE]
True, but once it gets to 90 degrees it should line back up, shouldn't it?
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Sat Jul 30, 2011 10:42 pm

[QUOTE=newt]
True, but once it gets to 90 degrees it should line back up, shouldn't it?[/QUOTE]
Yes, matrix rotation in 90 degree steps will work perfectly.

(as well as 180, 270, 360, etc.)tulamide2011-07-30 22:42:45
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Sat Jul 30, 2011 10:55 pm

Well the idea was for extra effect showing it rotate, but I get the feeling this is for an editor, so the extra steps would be pointless.
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Sun Jul 31, 2011 12:21 am

You mean something like that?

http://www.mediafire.com/file/1lmfgk4sfqpuhj7/rotatingsprites.cap

(Was too lazy to do ccw and omitted the array, which is a simple task to add now)
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Sun Jul 31, 2011 5:34 am

Yep, pretty much, the center around instance version.
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Previous

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests