Yann's Forum Posts

  • Mod edit :

    Please see : This tutorial

  • I guess the function forget the picking but without seeing the function I can't really say.

    Also I never used the TimeLine plugin so I don't really know what it does and how to use it.

  • Set default controls to No in the property panel

    You then will have to simulate the right and left movement but you'll be able to always jump.

  • In your case it seems to be a toggle

    you don't need another variable, just a bit of math

    Koopa: is overlapping flag
        -> Koopa: set Move to 3-Koopa.Move

    if move = 1 -> 3-1 = 2

    if move = 2 -> 3-2 = 1

  • fake8Direction.capx

    Or maybe just simulate control

    8DirSimulate.capx

  • global variable Timer
    System: Every ticks
        -> add dt to Timer
        local variable min
        local variable sec
            -> System: set min to floor(Timer/60)
            -> System: set sec to int(Timer)%60
            -> Text: set Text to right("00"&min,2)&":"&right("00"&sec,2)

    dt is a special word in c2 that return the time spent between two ticks. so after 60 ticks if you run at 60fps, so 1 second later, Timer will equal 1 (what a coincidence!)

    also the right(string,length) function return the right part of a string, so the expression will zero fill the number.

    % is the modulo operator:

       0%60 = 0

    20%60 = 20

    60%60 = 0

    80%60 = 20

    value tends to cycle when you use modulo. (officially a%b gives the remainder of the euclidian division of a by b... unofficially... easy cycling)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Just put Acceleration and Deceleration to something big like 5000

  • Sometimes I indeed need to apply stuff to a newly created sprite.

    Just today I did something like that :

    Add a boolean onCreate with default value true

    Mouse: On Left Click
        -> Create Sprite on layer 0 at 0,0
    Whatever condition you need to check
    Sprite: Is onCreate 
        -> Sprite: Do stuff
        -> Sprite: set onCreate to false
  • well, it's a pain and I don't have that much room for conversion 'cause the param you enter in cc when you use the plugin are input in the plugin via either simple int or string (as far as I know param[0].GetInt() or param[0].GetString() are the function used to retrieve the param). I'm not knowledgeable enough to know if I can create my own GetLongInt() function to handle that.

    And anyway, dec2bin and bin2dec really are just for checking how bitwise operation works, you really don't need that in the code itself.

    you will do a 8 and 4 (knowing that "binarily" it is 1000 and 100) If you do a bin2dec(1000) and bin2dec(100) instead, you lose all the speed and efficiency of bitwise operation.

  • global variable changeCount type number
    every tick : set changeCount to 0
    foreach Sprite
        Sprite animation Frame = 1  -> add 1 to changeCount
    
    ChangeCount >= your limit  -> do your stuff
  • Activate parallaxe in editor on layer properties

  • Sprite: Set Physics velocity to  whatyouwant , Sprite.Physics.VelocityY
  • Why should it go back to the first frame by default?

    You play an animation from frame 0 to frame n... then the animation stop (unless you made it loop) so it's logicall that it stop at the end.. the frame n.

    If you want the animation to go back to frame 0, you should have an event that tell it so.

    On animation finished -> set frame to 0.

  • Create Monster on layer ... position ...,...
    Monster: Set animationFrame to ...

    C2 will automatically pick the instance that is selected but only in the event in which it is selected.