dop2000's Forum Posts

  • 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?

  • 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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • [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:

  • You can get something similar (but not exactly what you described) with this formula:

    round(random(10)*random(10))

    For a much "steeper" results you can do this:

    round(random(1)*random(1)*random(1)*100)

  • Maybe he meant "purchased", not "published"?

  • You can't disable/enable event groups if something changes about individual NPC instances.

    When one NPC sees your character, you are disabling "eNPC Basics" and "eNPC States" groups. This affects all other NPCs! So this approach is completely wrong.

    Use instance variables, use For Each loops, different timers. But don't disable groups.

  • What are you talking about? Which objects, what actions? There are hundreds of events in your capx, what exactly should I look at?

    Edit: Ok, I see red NPCs. So what's wrong with them? Could you elaborate?

  • The system only checks for collisions when it's needed - if you have events "On collision" or "Is overlapping" or if there are behaviors on the objects that register collisions (platform, physics etc.)

    So normally your destroyables should not generate collisions check with the walls.

    You said your layout is (1400,800) - is this in pixels or is this the number of tiles on the tilemap?

    If in pixels, it's not that big and you should be able to use tilemap or even several tilemaps on top of each other.

    If you have lots of individual sprites like destroyables, you can disable/enable collision for them if they are too far from the character or in another room etc.

    System-> Pick by comparison-> Sprite where distance(Sprite.X, Sprite.Y, Character.X, Character.Y)<100 : Sprite Set collision enabled

    System-> Pick by comparison-> Sprite where distance(Sprite.X, Sprite.Y, Character.X, Character.Y)>=100 : Sprite Set collision disabled