Distance and object scale

Get help using Construct 2

Post » Wed Jun 18, 2014 6:21 pm

I decided to start prototyping a side-scrolling game with Dynasty Warriors feel, player vs huge hordes etc. It would probably look cool if enemies scaled depending on their height on the screen (y axis? forgot which one), but I'm not sure how to really do this. The scale of objects should depend on camera's position which is centered to player with slight lerp movement. I have no idea how to do this effect, but I'll try playing with something, such as calculating each object's y-distance to camera and substracting that from their scale or something.

Anyways, if anyone got a good idea, you're welcome to share it here!
B
21
S
7
G
4
Posts: 233
Reputation: 3,474

Post » Wed Jun 18, 2014 9:15 pm

something like this?
You do not have the required permissions to view the files attached to this post.
B
6
S
1
Posts: 51
Reputation: 502

Post » Thu Jun 19, 2014 12:02 am

Welp, that's simpler than I expected. Thanks for the example!

EDIT: Tested it with my game and it works well, except now I need to figure out how to make it so that enemies closer to camera (lower than player on screen) scale upwards instead of shrink like objects higher than player.

EDITEDIT: Disregard that, got it working. I just checked if the object's Y-position is higher or lower to player's and then added or subtracted the calculation accordingly. And next time I'll consider twice before editing posts.
B
21
S
7
G
4
Posts: 233
Reputation: 3,474


Return to How do I....?

Who is online

Users browsing this forum: AllanR, BackendFreak, brunopalermo, farsen, ST314 and 28 guests