Yann's Recent Forum Activity

  • WesleyNR

    Thanks for the info, I'll see what I can do about it when I get home (:

  • Start of layout:
       -> Set scrollY to Player.Y
    
    Everytick
       -> Set scrollY to scrollY-scrollSpeed*dt
    
    Player.Y > scrollY + windowHeight/2
       -> die

    (In the last one, I consider that the Player has it's origin point at the bottom (at its feet) if it's in the middle, just do

    Player.Y > scrollY + windowHeight/2 - Player.Height/2
       -> die
  • To get the nth digit (0-based) of a number you just have to do:

    (floor(x/(10^n))%10

    For instance

    The third digit of 123456
    =(floor ( 123456/(10^2) ) %10)
    = floor (123456/100) %10)
    = floor (1234.56) % 10)
    = 1234 % 10
    = 4
  • lerp(a,b,p) = a + (b - a) * p

    So in short if you imagine a and b being a start and end of a linear path, p is the percentage travelled.

    Also dt is the time in second spent between two frames

    so dt varies slightly but stay around 0.017 (1/60 fps) so 0.5*dt is more or less constant.

    The only thing you really change is scrollVar which is always random.

    What you probably want to do is having a fixed point, and a variable offset. The variation would be random, but the range of the randomness would decrease in time.

    So it should look like

    Every tick
        -> set range to max(0,range - 0.5*dt)
        -> set xOffset to random(-range,range)
        -> set scroll X to xFix + xOffset

    This way you just have to change range to trigger the shaking

  • WesleyNR

    Hmm weird, expressions works well with me. Maybe you did something wrong with the syntax and maybe I should have provided examples

    Anyway, the proper syntax is:

    If you created a timer like that

    Sprite: Start timer "test" with length 10000, Repeat, Don't destroy when finished

    you can get the current count and the initial value this way:

    Sprite[Timer].count("test")
    Sprite[Timer].initialValue("test")

    This way you can even display some percentages like this

    round((Sprite[Timer].count("test") / Sprite[Timer].initialValue("test")) * 100)

    (Ah I saw a small little mistake, for the initialValue expression it the default is value, it should be name)

  • aragon

    I've never used the ComboBoxListBox plugin before so I might be wrong

    Nevertheless, you're not using the proper parameters in the tokenat() function

    What you probably want to do is:

    ComboBoxListBox: Add: tokenat (AJAX.LastData, loopindex, "|")

    I don't really know what you want to do in event 3 since your condition is more or less the same as saying "if a = a" or event "Every tick" since it's always true and your second action is overwriting the first one.

    And also, since I've seen your php implementation, I think you have a trailing | at the end of your list, so a blank token. You might need to address that.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • aragon

    Instead of digging very old unrealated topic you should create your own really (: (it's not because someone mention loop that it's related to your issue)

    Now if you want an answer we need to be able to open your capx, and since it's full of third party plugin, it's a real pain (I don't want to install plugins)

    If you can't really get rid of them, try posting a screenshot of your event sheet.

  • aragon you should avoid posting the same question on different places. (it's not a likeable behavior). Moreover, your question is on a totally different subject.

    This current topic is a bug report on the interaction between function plugins, local variables and while loop. While you're asking something about php and AJAX mostly.

  • The speed of the platform behavior is always limited by the Max speed property.

    One way to make it work is to do something like:

    playerCollision: Is animation attack playing
        local number attackSpeed = 0
        local number defaultSpeed = 0
        playerCollision: [invert] Is mirrored
            ->System: set attackSpeed to 9000
        playerCollision: Is mirrored    
            ->System: set attackSpeed to -2000
        -> System: set defaultSpeed to playerCollision.Platform.MaxSpeed
        -> playerCollision: set Platform maximum speed to attackSpeed
        -> wait 0.2 seconds
        -> playerCollision: set Platform maximum speed to defaultSpeed

    Be carefull, since you probably didn't know about the max speed issue, you probably set the speed way to high since it was always clamped to max speed which default to 330...

  • Never really understood why (:

    Anyway I only ever use inclusion when I really need the same piece of code in 2 (or more) different event sheet, which is pretty rare since either I use one layout/event sheet for the whole game, or I use the same event sheet on every gameplay layout

  • About the start of layout issue, there's this rule to keep in mind:

    "Start of layout of included sheets always happen before the start of layout of the current event sheet even if it's placed after."

    For your other issue, I would need to see at least a screenshot of the conserned events.

  • About your dt issue, you can do an "every x second" this way:

    +Every ticks
       -> add dt to timer
    +timer >= x
       -> substract x from timer
       -> do things
Yann's avatar

Yann

Member since 31 Dec, 2010

Twitter
Yann has 5 followers

Connect with Yann