How do I anglelerp

Get help using Construct 2

Post » Fri May 30, 2014 9:54 pm

hello everyone.
i need some clarification on this.
If "player" is overlapping "slope"------------------ "player" set angle to anglelerp(self.angle,340,0,9*dt) degrees.
on the third number which is how fast it will lerp it makes no difference in speed whatever i input.
meaning if i enter there 0.1 or 0.9 it anglelerps at the same speed.
what am i doing wrong?
thank you.
B
15
S
6
G
4
Posts: 277
Reputation: 3,948

Post » Fri May 30, 2014 11:35 pm

actually lerp(a, b, x) should have the x parameter variying, not the a parameter (it is a simple linear interpolation by defining a 0 to 100% value), it just happens that it do something else the way you (and not only you) are using it (I think this is called a geometric progression), but in your case:

-did the angle moved too slowly? (since 0.9*dt is a very low value, it will stay relatively close to Self.angle, and so self.angle won't vary that much even at the beginning), maybe a 0.5*60*dt will be more noticeable (it should be half way of it's current position 1/60 of seconds later).
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 31, 2014 1:42 pm

@Aphrodite
you rock as always!
i will try this and report back.
Does anyone know if we can pick a specific tile from the tilemap object and enable or disable the sine behavior?
i know that we can give the WHOLE tilemap object the sine behavior but can we move individual tiles so i wont have to use sprites for this?
B
15
S
6
G
4
Posts: 277
Reputation: 3,948

Post » Sat May 31, 2014 2:09 pm

The tilemap object is one big object, I don t think in C2 you can move one tile (since what defines a tile is it's X and Y position on the tilemap), what could be done potentially would be to compare each tile, and when you encounter a particular tile, you create a sprite over it, and destroy the tile then, this operation would have to be done on the start of layout (maybe it can also work on the tilemap trigger condition "on created", 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


Return to How do I....?

Who is online

Users browsing this forum: MassimoF and 27 guests