Distance and object scale

0 favourites
  • 3 posts
From the Asset Store
Welcome! I-Spy (Hidden objects) is an educational puzzle that is more than just seek-and-find activities.
  • 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!

  • something like this?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)