How do I rotate object on X or Y axis?

Just started using Construct 2? Post your questions here

Post » Thu May 22, 2014 12:35 pm

Hello!

I wonder if it was possible to rotate object on an other axis than Z! That all !

Thank you !
B
15
S
4
Posts: 57
Reputation: 1,792

Post » Thu May 22, 2014 1:21 pm

You can't rotate a sprite or object on another axis , why you need that ? Paper mario clone :p ?

Image
B
13
S
3
G
2
Posts: 49
Reputation: 1,675

Post » Thu May 22, 2014 5:59 pm

@orugari :

C2 isn't a 3D engine, so indeed you cannot spin around axis other than Z, however, you can simulate the other rotations, IF you only rotate one of them at a time

exemple: https://dl.dropboxusercontent.com/u/100 ... index.html

You might be able to simulate Z + one of the others, but not sure about that
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
53
S
22
G
18
Posts: 2,122
Reputation: 17,123

Post » Sat May 24, 2014 8:38 am

@Aphrodite I know it is not a 3D Engine :p But yeah I mistake explaining ! But your example is pretty what I wanted to do!
Simulate rotating, things you can do with css3 and jquery (well, I did with css3 so it's why I wanted to know... ^^)
is there a capx showing how to do this?
Merci beaucoup

@vioz absolutly ahah :p
B
15
S
4
Posts: 57
Reputation: 1,792

Post » Sat May 24, 2014 10:55 am

orugari wrote:@Aphrodite I know it is not a 3D Engine :p But yeah I mistake explaining ! But your example is pretty what I wanted to do!
Simulate rotating, things you can do with css3 and jquery (well, I did with css3 so it's why I wanted to know... ^^)
is there a capx showing how to do this?
Merci beaucoup

@vioz absolutly ahah :p


I was basically:
Setting first two instance variables, ini_width and ini_height, to the sprite initial size
setting a variable called X_Angle, and to rotate it, setting the height of the sprite to:
Sprite.ini_height*cos(Sprite.X_Angle)

And a similar operation for the height

Depending on the origin point, you also might have to place the sprite correctly after (my exemple had it s origin first right in the center, then on the bottom left, which will affect the rotations)

I may have time to do an exemple capx when I'll be on ly computer if you want one.
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
53
S
22
G
18
Posts: 2,122
Reputation: 17,123

Post » Sat May 24, 2014 2:03 pm

Thank you for explanation!

Well if reaaally you have time and motivation for it, I will take it with pleasure !
B
15
S
4
Posts: 57
Reputation: 1,792

Post » Sat May 24, 2014 11:08 pm

@orugari : here it is: https://dl.dropboxusercontent.com/u/100 ... emple.capx

It should be enough for a feeling of rotation, however keep in mind that since it is a not-so-precise illusion of rotation, precaution should be taken, also all objects are flats of course (but since you've explained it should be for a paper character feeling, should be good enough)
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
53
S
22
G
18
Posts: 2,122
Reputation: 17,123

Post » Sun May 25, 2014 5:19 am

I thanks you thousand times! (but in the capx, nothing happend)
I'll work on the function you gave me!

Scirra has such a wonderful community ! (And bought my License yesterday, I am happy :p)
B
15
S
4
Posts: 57
Reputation: 1,792

Post » Sun May 25, 2014 10:29 am

orugari wrote:I thanks you thousand times! (but in the capx, nothing happend)
I'll work on the function you gave me!

Scirra has such a wonderful community ! (And bought my License yesterday, I am happy :p)


Change the value of Angle_X and Angle_Y before previewing, I didn't add something to modify it automatically
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
53
S
22
G
18
Posts: 2,122
Reputation: 17,123


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 3 guests