dop2000's Forum Posts

  • I can't open your project as it uses some effect which I don't have. But I'm almost certain the problem is with the collision polygons. Ideally the Origin point and collision polygon should be identical for all frames in all animations of character sprite.

    A very common approach is to use an invisible sprite (simple box) with Platform behavior for controlling the character. And pin your character sprite with all animations to that sprite. Then you will not have these issues.

  • You can save and restore progress with Local Storage, either as a single variable, or as an array/dictionary.

    dropbox.com/s/szxb22rfzfcv9if/localStorage2.capx

    dropbox.com/s/f2d7lc8o4zajgeg/LocalStorageDemo.capx

  • The easiest way is to spawn a sprite with Fade out behavior at Player position on every tick.

  • It's not as easy as it seems.. Normally you add delays in loops using loopindex expression, but "JSON for each property" loop doesn't support loopindex, and JSON.CurrentKey/CurrentValue are not available after Wait.

    So the only solution I could think of is to load all keys and values into a temporary array and then do this:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can compare each line in a loop using tokenat expression. There may be an easier way with regex, but I don't know it.

  • Could you share your project file? I am still quite sure that these conditions are useless and not required here, but maybe I can find the real reason why the code doesn't work without them.

  • Are you talking about the last formula? It should work with any number of frames in the animation.

    .

    I am not very good at explaining..

    (((mouse.X-startX)/8)+(Sprite4.AnimationFrameCount*10)+startFrame)%Sprite4.AnimationFrameCount

    Here "8" means sensitivity - frame will change every 8 pixels.

    %Sprite4.AnimationFrameCount is the remainder after division. For example, 50%36 will give you frame number 14 in animation with 36 frames.

    (Sprite4.AnimationFrameCount*10) - this part of the formula is needed to prevent the value in brackets to go into negative numbers (when you swipe to the left). It basically just adds 360. For example:

    (10+360)%36=10

    (-10+360)%36=26

  • Keyboard On C pressed
    System For each Door
    	Door Solid is enabled -> Door Solid set disabled
    	Else -> Door Solid set enabled
    
  • tokencount(text, newline)-1

    You can wrap text in trim() expression to remove any line breaks at the end:

    tokencount(trim(text), newline)-1

  • You don't know how to rename a file??

    mediacollege.com/microsoft/windows/extension-change.html

    Or you can simply try to open .caproj file with Construct 2, the same way you normally open .capx files.

    I tried opening the file from your link, it's still corrupted.

  • You can try this clamp:

    clamp(lerp(Self.X, (Player.X+d*cos(a)) , 5*dt), Player.X-MaxDist, Player.X+MaxDist)

    clamp(lerp(Self.y, (Player.y+d*sin(a)) , 5*dt), Player.Y-MaxDist, Player.Y+MaxDist)

  • I don't quite understand what are you trying to do with those clamp() expressions, but they won't work like that.

    If you don't want the camera to go further than 100 px from the player, set MaxDist to 100. Also, try to increase camera speed in event 3 - change to "10*dt" for example.

  • I don't understand why you had to add those conditions. I don't think they change anything, because at least one of them is always true, so there is no point in them.

  • I made some changes, have a look:

    dropbox.com/s/sazmpsmexk4mmn5/RightStickCam.c3p

    EDIT - Actually, this version may be better:

    dropbox.com/s/ocyz4hzyiqdt3zf/RightStickCam2.c3p

  • You are probably using a condition like "Is Button down" or "Is in touch". This conditions are executed on every tick, 60 times per second.

    You need to use a triggered event, which is executed only once. They usually start with "On" - "On key pressed", "On touch start" etc.