dop2000's Forum Posts

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

  • Try Construct 3

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

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

  • 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

  • Top number on your left image should read "-90" or "270".

    I don't really understand what your problem is. If you are trying to increase the angle by 90 degrees (or rotate it 90 degrees clockwise), you can simply add 90.

    Set Sprite angle to (Sprite.angle+90)

    This might give you a result which will be greater than 360, but the system will convert it to correct angle.

    Or you can use anglerotate expression:

    endAngle=anglerotate(startAngle, startAngle+90, 90)

  • There are a few expressions related to angles:

    angle(x1, y1, x2, y2) Calculate angle between two points

    anglelerp(a, b, x) Linearly interpolate the angle a to b by x. Unlike the standard lerp, this takes in to account the cyclical nature of angles.

    anglediff(a1, a2) Return the smallest difference between two angles

    anglerotate(start, end, step) Rotate angle start towards end by the angle step, all in degrees. If start is less than step degrees away from end, it returns end.

    You're probably looking for anglediff, although you should know that it always returns positive result. I.e. anglediff(10,50) returns 40, and anglediff(50,10) also returns 40 (not -40).

    Also these system events may be useful: "Is between angles", "Is within angle", "Is clockwise from"