How to have camera zoom not zoom out on background layer

dorme1dorme1 Member Posts: 11
edited November -1 in Working with GS (Mac)
Hi

I'm making a bouncing type game and the problem I'm having is it's hard for the player to see where to go next, I'd like to zoom out when the ball hits the actor that bounces the ball. I have the camera zooming out, but it's also zooming out so you can see where the background image ends. (The background layer is in the lower left corner of the screen surrounded by black/blank area) (The scene is 960X640 and the background image is 480X320 - and on a non moveable layer) Is there a way to correct this without stretching my background image?

Comments

  • StormyStudioStormyStudio United KingdomMember Posts: 3,989
    no, unfortunately the only way to do it is to animate an offset for your background actor as zooming the character affects everything...

    annoying but true i'm afraid...

    good luck sorting it...
  • dorme1dorme1 Member Posts: 11
    Thanks for the response. That's kind of a bummer. The problem isn't moving left and right so much as it is when the object is headed downwards, it doesn't move the screen until it's too late and I've tried adjusting the camera size all over the place. Perhaps some of your code from your "bit of math that works" might help. Thanks again.
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    Seems like you just need a larger background image. As long as you don't let the camera origin go below 0,0 or above the height/width of the background you should be ok. Maybe use the old min(max()) trick to limit the high and low ends of the range when zooming out. That way it won't zoom out too far. Hard to know exactly what the problem is from your description.
  • dorme1dorme1 Member Posts: 11
    I think I fixed the issue just by spawning a "camera offset" actor that is constrained to the position of the "ball" actor with a -80 after the y position (so when the ball is traveling down, you get a little time to react) I'm hesitant to make the background image bigger right now. BUT I may need to in future levels. This is fun and way more work than I thought it'd be (mostly creating the artwork) good times!
Sign In or Register to comment.