Isometric rotation

Get help using Construct 2

Post » Mon Nov 05, 2012 2:54 am

I was wondering if anyone knew a way to rotate a isometric background when the player moves?
I have tried to set the background to the rotate behaviour that when player moves left, background rotates clockwise, and when player moves right, background rotates counterclockwise.

But once again I dont want the background to exceed a certain angle (as in I dont want my isometric background to rotate past a certain degree).

The pseudo code would look something like this:
If player moves left, then rotate Isometric background clockwise 1 degree
if background angle = 180 degrees then lock background angle
If player moves right, then rotate Isometric background counterclockwise 1 degree
if backround angle = 180 then lock background angle

By lock I mean the background stops rotating past 180 degrees and wont go above that.

I want to use a "half-rotation" effect to kinda simulate 2.5D on a isometric game, but am having some trouble thinking this through. Is there a way to save the angle of the background to a global variable, so that I can compare the angle to the value in a variable?

I was also wondering if anyone had any concept ideas, calculations, Capx files or algorithm that they would be willing to share?

Any help would be appreciatedretrodude2012-11-05 02:55:12
B
18
S
4
G
3
Posts: 436
Reputation: 4,801

Post » Mon Nov 05, 2012 6:41 am

I tend to use an easing effect rather than locking...so use two separate events..
Event 1
1st condition-> player presses left,
2nd condition-> if background angle =or <= 180 degrees
3rd condition-> every tick
Action-> rotate Isometric background towards required angle 1 degree

Event 2
1st condition-> player presses left,
2nd condition-> if background angle >= 180 degrees
3rd condition-> every tick
Action-> rotate toward 180 1 degree..

and of course repeat for the right side.

It can also have an eased snap back to original position by removing the player presses key condition and setting the rotate towards angle to the original..

by using rotate rather than lock its a softer feel and uses the less than or equal to functions..but it sound like you are only rotating the screen as a fake isometric rotation..you could always make a few version of the background art at various angles to get a more realistic viewmystazsea2012-11-05 06:43:38
When in doubt..or you are lost in a Zombie apocalypse or someone is giving you a hard time..Remember one thing..... Read the Construct 2 Manual..it will save your life.:)
B
30
S
11
G
8
Posts: 313
Reputation: 7,360

Post » Mon Nov 05, 2012 2:59 pm

[QUOTE=mystazsea] I tend to use an easing effect rather than locking...so use two separate events..
Event 1
1st condition-> player presses left,
2nd condition-> if background angle =or <= 180 degrees
3rd condition-> every tick
Action-> rotate Isometric background towards required angle 1 degree

Event 2
1st condition-> player presses left,
2nd condition-> if background angle >= 180 degrees
3rd condition-> every tick
Action-> rotate toward 180 1 degree..

and of course repeat for the right side.

It can also have an eased snap back to original position by removing the player presses key condition and setting the rotate towards angle to the original..

by using rotate rather than lock its a softer feel and uses the less than or equal to functions..but it sound like you are only rotating the screen as a fake isometric rotation..you could always make a few version of the background art at various angles to get a more realistic view[/QUOTE]

Thanks alot, ill definetly try this out
retrodude2012-11-05 15:13:18
B
18
S
4
G
3
Posts: 436
Reputation: 4,801


Return to How do I....?

Who is online

Users browsing this forum: Unconnected and 28 guests