Logic For A Super Mario World Styled Camera

Not favoritedFavorited Favorited 0 favourites
  • 3 posts
From the Asset Store
100 items casual and logic games. All icons are of a high quality.
  • To be clear I've been at this for about a day and I just am lost about what to do. For context I'm using a seperate Camera object with scrollto on it. Also This is more of a logic question rather than a "can you code this thing for me lol" question.

    I've been trying to make a Mario world styled camera as the title suggestions, but everything I can think of just doesnt work. For context as to how the Mario World camera works: youtube.com/watch . Also a little more context for what I'm trying to achieve - I DONT want a smooth camera. It's true that I want the camera to adjust itself and move according to the player but I want it to be purely linear movement. Smooth cameras tend to have this sort of slow down and speed up effect when stopping or starting that I find to look pretty bad.

    My first idea was to have the camera object be tweened to a "CameraMoveObject" (the solid white lines in the image attached) once the player collides with a "CameraBorderObject" (the dotted lines). First off this didn't really work as expected... YES it did move to the CameraMoveObject but it would only move to one. Okay. Makes sense. So I tried to Pick by UID and then it just stopped moving to the object completely. Then I tried assigning it a variable and it'd only move to that object if it had that variable. Same thing that happened with UID happened here. At this point I just gave up and made them two seperate objects. Okay cool that works now.

    Now a new problem, I have no idea where to go from there. How would I go about setting the Camera to only follow the player when theyre colliding with the camera move object? How do I make the camera still be at an offset when following the player? Better yet how do I even have each CameraMoveObject/CameraBorderObject follow Mario at a certain distance. (I could probably achieve this by setting a layers parallax to 0, 0 come to think of it but that doesnt seem right either...)

    So does anyone know any Construct actions/conditions/behaviors/ect that help develop a system like this? Sorry for being super vague and not really providing code but I really just don't know how to go about this.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • From what I've noticed.

    Horizontally, the camera only moves if the player moves a certain distance. This distance needs to be a variable to adjust for your platformer.

    Vertically, the camera moves when landing on a platform. But the camera always shows the floor or another platform from below so the player can see where to jump. This is also a variable.

    I'm not an expert on platformers, this is what I was able to figure out in the video.

    Here's an example.

    fex.net/s/zo5e8sz

  • Thank you! I tried to modify it a bit to fit my needs more but I couldn't get it down exactly. It also still has that "smooth camera" effect where once stopping the camera lags behind the players position a bit which i don't like. Like once the player stops moving the camera has to take a second to readjust to the players position, which is a small thing but IMO it really affects the game feel. I realize I explained it pretty badly before that's what I meant. Also this is probably my horrible convoluted code but for the life of me I can't find a way to make the transition between the camera switching sides to be less snappy and slower like in the Mario world one. It can get pretty dizzying if you're going left and right a lot. I also made a few changes to the Y scrolling so that way once you pass a certain point on the screen the camera will auto scroll down a bit.

    I really tried my best to understand the expressions here since my comprehension of expressions as a whole is pretty weak. (I have bad dyscalculia) But I think I was able to understand most of it...?

    Anyway I'm pretty happy with how it's coming along so far! I just need help with ironing out these few things... Thank you!

    Here's the capx: dropbox.com/scl/fi/hlzlw456phs3oseemv95m/CameraMario.c3p

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