dop2000's Forum Posts

  • Something like this?

    For "x"=0 to LayoutWidth/Sprite.Width

    ...For "y"=0 to LayoutHeight/Sprite.Height -> Create Sprite at (loopindex("x")*Sprite.Width, loopindex("y")*Sprite.Height)

    Origin point in the sprite should be at (0,0)

  • Yeah, since you are doing this on start of layout, you can mask this lag using some transition effect.

    For example, put a big black TiledBackground on top, add Fade behavior, set it to fade out and destroy after 1 second, then change your loop to this:

    for x=0 to 9     -> Wait 0.1*loopindex
       for y=0 to 999  -> Set Array.At(loopindex("x")*1000+loopindex("y")) = f(loopindex("x")*1000+loopindex("y"))
    [/code:12uzv96i]
  • Based on the very little information you provided, you might need Anchor behavior:

    https://www.scirra.com/manual/88/anchor

  • I see you fixed that issue with event groups.

    Instead of boolean variable isInteracting, use numeric interactingUID, with default value -1.

    Then change your events to these:

    Grabber interactingUID=-1
    Grabber is overlapping nMask  -> Grabber set interactingUID to nMask.UID
    
    nMask Pick by Unique ID = Grabber.interactingUID
    Grabber is NOT overlapping nMask  -> Grabber set interactingUID to -1[/code:10dl9stx]
    
    When Grabber.interactingUID is set, you can easily pick nMask instance by UID in other events.
  • You don't really need currY variable, you can use loopindex*75

  • saeris

    Seems like R0J0 found a better solution (as he always does )

    Anyway, SpriteFont has a number of expressions (characterHeight, characterWidth, characterSpacing, lineHeight), which you can use to calculate the screen position of any character in your text. So if you need to highlight the word "John", you find coordinates of letters "J" and "n" and put some sprite with blend mode in that position, or draw a line underneath. It's not an easy task, but possible.

  • FabianB

    If you have two objects with scrollTo, view will be scrolled in between them.

    It's hard to help if you can't explain the problem. Maybe you could share your capx? Or post a link to youtube video with the same camera effect?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • See this post:

  • No, I'm pretty sure in terms of performance they are the same.

  • Not sure if I understood you correctly.

    So when player collides with red switch, you want to open the red door? On collision with blue switch, open blue door and so on?

    Add "Color" instance variable to both Switch and Door sprites. Set correct Color for each switch and door ("red", "blue", "green" etc.)

    Your code could look something like this:

    Player on collision with Switch
       Door compare instance variable Color=Switch.Color  -> Door set isOpen=1
                                                             Door set animation to "Open"
    [/code:641e481b]
  • LoS is just a condition, you can combine it with other conditions to filter out "destroyed" instances.

    Target Compare instance variable Destroyed=0      ->  AI Spawn bullet ....
    AI Has LoS to Target 
    [/code:37tpf4lk]
    
    First condition will pick all not destroyed targets. Second condition will check if AI has LoS to any of them.
  • It very much depends on your function. Loops themselves are not slow. You can put some simple math formula in a "Repeat 10000 times" loop, execute it on every tick and still get 60 fps.

  • There are quite a few problems with your code:

    First, smallest frame time in C2 is about 0.016 seconds, so starting timer for 0.000005 is the same as starting it for 0.016s

    Your event #5 doesn't have any actions and will never work anyway, because angle is never equal to itself+90. Same with #7.

    On timer when the card starts rotating, you change its isTapped variable. You should do this after rotation has finished.

    Your code allows to click the card while it's still rotation.

    Your timers are running forever, even after rotation is stopped, timers continue to run.

    Here is the demo showing 3 different ways to rotate your card:

    https://www.dropbox.com/s/fyal1pkopl8rx ... s.c3p?dl=0

  • [quote:2fmk793g]a few paragraphs of text where I could have certain words of it link to external pages (imagine a list with client names etc)

    If nothing else works, you can probably do this with sprite font.

    It will be a tiresome task, but with sprite font you should be able to calculate the exact position of each letter, underline or highlight words (using sprites) to make them look like Internet links. And on mouse click detect which word was clicked.

  • There is probably a better way to do this with some math kung fu, but this should work: