WRS's Forum Posts

  • How to make a display system of 3 stars in menb level selection?

    I made a system that puts the level number in the array. But then I cannot compare the actual level with the array cell. What am I doing wrong?

    I have this logic.

    If the player passes the level and the global variable (STL) = 0, then at the end of the layout I send the level number to the array, that is, if level 3 is playing and the variable STL = 0 then add the level to the array.

    Next I wanted to compare the Level and the corresponding cell of the array and if they are equal then set the star.

  • Use custom obstacles for the Line Of Sight behavior.

    Does not work.

    I have a TITE CARD of which I create a HARD behavior and put a TAG - GLASS. Then I make a script for the player (he has the behavior of 8 sides of the movement). And either the player crashes into the glass and the zone of visibility does not penetrate him, or the zone of visibility penetrates him and the player himself can pass through the glass

  • Thanks a lot of good examples.

  • Use custom obstacles for the Line Of Sight behavior.

    Thank. I will try.

  • Hi everybody. Who made the glass?

    How to create an object such as glass, it must be solid so that it cannot be passed through it, but it must be transparent so that you can look through it.

    The player must be carried into the glass, that is, it has a solid behavior but at the same time it must be transparent to the "field of view" behavior

    Tagged:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • trigger once while true (this will trigger once for the instance of the object, if there are more it will trigger for each and every one of them), or global variable, set can play to 0 and if played set it to 1 if user goes in screen and canplay=0 set 1 play song, if is =1 doesn't play.

    Yes, it worked, needed a global variable. Thank!

  • What condition can solve the problem with looping sound reproduction?

    If the player is in the field of view of the camera - the alarm is activated.

    The problem is that if a player repeatedly gets into the camera's view, the music is turned on and on. Even the use of a variable does not save.

    It should be. No matter how many times a player gets under the camera's vision, the music starts once and plays all the time.

  • Patrolling with pathfinding:

    https://www.dropbox.com/s/nglwbuzmdjpd7os/PatrollingEnemy2.capx?dl=0

    Thank. I will disassemble)

  • WRS

    for my sample, you can have as many triggers as you want and move them anywhere. You just have to change the angle of the trigger to point to the next one (and make sure they are lined up so that the patrol will hit the next trigger).

    Yes, I figured it out, there was a bug in the construct, and after the new load everything started working)

    Thank you very much

  • Try this one:

    https://www.dropbox.com/s/eeuzglzwkdimlv3/PatrollingEnemy.capx?dl=0

    Oh, thank you very much)

    If this circle is working fine) And if this is a difficult route, then it turns in one direction. I will try to create additional triggers and turn to another side. It may help.

  • Another way to do this is with Pathfinding behavior - for each enemy find path to the next patrol point. Pathfinding will take care of sprite rotation, acceleration/deceleration etc.

    Then you have to create a lot of unique triggers?

  • WRS

    it was a little more complicated than I expected when there were multiple patrol objects and lots of triggers. In my sample, patrols move until they hit a trigger, they then turn until they match the angle of the trigger, then start moving again.

    If a trigger is set to an angle of 90 degrees, C2 sometimes thought it was a small fraction off (like 90.00002), so you have to round the angles before comparing.

    I also ran into trouble when multiple patrols were overlapping triggers at the same time - you have to make sure you are comparing to the correct trigger.

    then, if the difference in direction is more than 180 degrees, you probably want to turn the shorter direction, so in that case the patrol turns -5 degrees.

    you can get my sample here:

    https://www.rieperts.com/games/forum/patrol.capx

    EDIT: one important note is that, obviously, if the patrol is turning 5 degrees (or -5 degrees) per tick, then you have to make sure the angle of the trigger is a multiple of 5 - otherwise the angle of the patrol will never match up with the angle of the trigger and it will just spin around on the trigger forever...

    The system is very difficult to work and if I just put triggers in a different order, then everything is working to work (

  • Thank you so much guys. Already broke his head on this.

  • Using the behavior of the bullet and triggers, I create a model patrol, when the object touches the trigger, it is rotated 90 degrees but does so sharply, but should do so smoothly.

  • thank you very much, I will try to do