Camera movement.

  • Hi everyone! My first post here and i'm not really good in english; i try to make a solid platform engine for my project. Well, my big issue with this is that i'm more skilled with graphic than the programming part but i always try.

    I making a platform with big sprites, and i want to use in it a smooth camera movement, (similar to a "sonic" 'cause my sprite is a runner too).

    Also, i want to give at the player the possibility to scroll up and down the camera to see what is above and under the sprite.

    The Y movement is another problem: well i said my character is a runner, this means high velocity, and if it fall down from a platform i need also to see where she land.

    Using lerp i'm not able to do anything of this, i mean... i made some results with the X movement, but not good as a playable platform like that i need.

    I want to ask what solution can be the best to resolve all this requests, and how to do: like i said i'm not really "pro" in the program part, but i like to learn. If someone can help me it will really appreciated, thanks.

    Sorry for my english, i'll try my best XD

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Anyone? Well...

    Ok, I'll try some experiment on my engine here but i really don't know if i'm doing right or not (don't mind if i insist) .

    My principal Sprite is named "candy_sprite" so...

    First i create a object "camera" with a ScrollTo behaviour. This Obj is controlled by this two statements:

    (only if faced right)

    If Idle anim. is playing

    If is faced right:

    lerp(camera_X,candy_sprite_X+100,0.06)

    If running anim. is playing

    If is faced right:

    lerp(camera_X,candy_sprite_X+120,0.08)

    This to explain, i had choose different values to obtain two camera position in two different situations.

    In the first one you are in idle, and the sprite is positioned in the half left portion of the screen (more spacing view in the half right portion)

    In the second one you are running, and for the lerp effect the camera is centered over the sprite, you are in the center of the screen then.

    This is not bad, i mean, i make this way because is better the transition of the camera when you are stopped and faced right and decide to turn left, or viceversa.

    But this is it, i can't figure out how to play with this possibilities, for example, in future i want to made it possible to press up and down keys to change the perspective of the level.

    But my "scripting aknowledgement" is not very effective, for example, i don't know how to stop the camera reached one specific point and i'll try but, i simply... can't figure out how to do.

    Also... all this is ok for the linear movement in the X axis, but not for Y, i mean... if the camera is centered, and is positioned near the head, or over the head of your sprite when you are falling result in this:

    So... when you fall, you can't really see what is bottom, and you can't react in time if there was some dangering zone or whatever.

    I admit that i haven't really figured out how a video game camera works, or works in construct but...

    Well, i hope i have explained better now. If someone want to explain me or want to give some hint, is really appreciated.

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