1. Hey! Guest! The 36th GMC Jam will take place between February 27th, 12:00 UTC - March 2nd, 12:00 UTC. Why not join in! Click here to find out more!
    Dismiss Notice

Cut scene with views

Discussion in 'Programming' started by Marc Malak, May 23, 2017.

  1. Marc Malak

    Marc Malak Guest

    Im not sure on how to do this but my game is a 2d platformer and what j want is for the view to start somehwere high (which i know how to set) then for the view to like move down at a constant speed until it reaches the player. But i thought about it and i have 2 issues.

    1: my view 0 follows my player so if i try to set it somehwere high then for it to go down it wont because its stuck to my player.

    2: also im not sure how to manipulate the view so that i can make it move down at a speed then stop it at the player.

    So i was wandering if anyone had anyodea of how to achieve this
     
  2. Simon Gust

    Simon Gust Member

    Joined:
    Nov 15, 2016
    Posts:
    3,258
    In the room Editor under views there is an Option for how fast the view follows the Player.
    upload_2017-5-23_13-21-26.png
    Set both to 4 or something.

    To put your view somewhere, write
    Code:
    view_xview = 500;
    view_yview = 100;
    
    You just have to get the right coordinates.
     
  3. DukeSoft

    DukeSoft Member

    Joined:
    Jun 20, 2016
    Posts:
    800
    You have the view follow speed variable, right? I think that does exactly what you're looking for.
     
  4. Marc Malak

    Marc Malak Guest

    Wait ok i have like a basic animatio at the start which runs then after animating a player object is created. So i dont want to base that movement around the player. Is there a way to just set the view in room to a position then move it until the right position for where the player is supposed to spawn?
     
  5. Simon Gust

    Simon Gust Member

    Joined:
    Nov 15, 2016
    Posts:
    3,258
    You can set the views starting Positions in the views tab. <View in Room>
    Once you create the Player object, write in it's create Event
    Code:
    view_object = obj_player;
    
    Make sure that in the views tab, no object as <Object following> is selected.
     
  6. DukeSoft

    DukeSoft Member

    Joined:
    Jun 20, 2016
    Posts:
    800
    I usually do some stuff myself with the view code...

    Code:
    target_x = obj_player.x-view_wview[0]/2;
    target_y = obj_player.y-view_hview[0]/2;
    
    if (view_xview[0] != target_x) {
        view_xview[0] = (view_xview[0]-target_x)*0.1;
    }
    
    if (view_yview[0] != target_y) {
        view_yview[0] = (view_yview[0]-target_y)*0.1;
    }
    
    
    
     
  7. SayBaconOneMoreTime

    SayBaconOneMoreTime Member

    Joined:
    Mar 18, 2017
    Posts:
    88
    My method for animating in a room is to have an object which controls the position of the view, and then have it contain a variable which controls where the view actually focuses on. It's based on Shaun Spalding's dynamic camera system tutorial, but a little bit more advanced. Is that something close to what you are after?
     
  8. Marc Malak

    Marc Malak Guest

    thank you!!
     
  9. Yal

    Yal GMC Memer GMC Elder

    Joined:
    Jun 20, 2016
    Posts:
    4,214
    I heard an interview quote from the devs behind Freedom Planet recently where they mentioned they switched over to Visual Novel-style cutscenes instead of full animation because it was too much work to make the cutscenes in the first game, they had to make scenes from scratch every time. I can totally get behind that thinking from my own experiences, too. Keep that in mind when designing cutscenes, and try to make reusable systems whenever possible to cut down on the amount of redundant work you need to do.
     
    DukeSoft likes this.

Share This Page