bizzy401's Recent Forum Activity

  • https:// drive.google.com/open?id=0Bzy8n1DGExZvOEVidGRXLUc0WHc <---remove the space after the https://

    Here is what I am working on, both methods that were proposed work, but if the leftPlayer and the rightPlayer switch sides it ceases to work properly. I think I may have to make four different "if" statements depending which sides them players are at to get it to =work right

    Thanks for all of the help.

    The game has to be controlled with a controller for the record...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I have two objects that move and I have another object that I would like to stay in the horizontal and vertical middle of both objects. Lets call the to moving objects leftPlayer and rightPlayer and the middle object spr_middle. I made global variables that sets itself to the horizontal distance and vertical distance between leftPlayer and rightPlayer every tick.

    Suppose that the screenWidth is 1000, leftPlayer.X is 250 and rightPlayer is 750. spr_middle should be at 500. Every tick this should adjust itself depending on how leftPlayer and rightPlayer move. After I figure that out I could do the same for the height and the Y axis...

    Thanks for any help...this has been driving me crazy...

  • Okay, I am trying to get this to work and I just can't figure it out. I have attached the capx if anyone would like to take a look and explain what I am doing wrong. Thank for all the help!

    drive.google.com/open ... DFxWWZSbkU

    [EDIT]

    Okay, so i got it working perfectly, here is the code that worked;

    X Code

    lerp(scrollx,(clamp(spr_Player.X, spr_Room.X+(0),spr_Room.X+spr_Room.Width-(1920))),0.1*60*dt)[/code:1g8g8hbl]
    
    Y Code
    [code:1g8g8hbl]lerp(scrolly,(clamp(spr_Player.Y, spr_Room.Y+(0),spr_Room.Y+spr_Room.Height-(1080))),0.1*60*dt)[/code:1g8g8hbl]
    
    This also allows for larger rooms as long as they are multiples of 1920x1080
    
    Thanks for all of the help!!!
    
    [b][EDIT 2][/b]
    
    So larger rooms aren't working right...I will post here if I can figure it out...
  • I found a tutorial on youtube.com/watch that I am trying to understand, but the tutorial has no commentary. Could someone please explain how to the code is doing what it is doing. I can replicate the tutorial with no problem, but I don't understand it enough to change things in it for the desired effect. Thanks for your help.

    The code is in the video at 9:20

    lerp(scrollx,(clamp(Player.X, Zone.X+(160),Zone.X+Zone.Width-(160))),0.1*60*dt)[/code:1nsem39b]
    
    I kind of understand lerp and the three descriptors that it needs, I'm not quit sure about clamp, I understand sprite coordinates, I understand that the 160 is the midpoint of the "Zone" sprite. The last part 0.1*60*dt is what is getting me, I think. I also have no idea what scrollx does exactly...
    
    I am trying to get it to work so that the screen is 1920*1080 and the rooms are the same size and it transitions smoothly to the next room. The rooms will be on a grid thats 10x10. 100 variables for the rooms is just too much, and this seems a lot cleaner.
    
    [edited for clarity]
bizzy401's avatar

bizzy401

Member since 29 Nov, 2013

None one is following bizzy401 yet!

Trophy Case

  • 11-Year Club
  • Email Verified

Progress

12/44
How to earn trophies