Asmodean's Forum Posts

  • You could use the behavior-plugin from rexrainbow.

    http://c2rexplugins.weebly.com/rex_moveto.html

  • I made a little example. Is it that what you're looking for?

    drive.google.com/file/d/0B5FlDY8sggF4d0xHX2Z6eWRBYms/view?usp=sharing

  • I made something. Maybe is what you looking for:

    drive.google.com/file/d/0B5FlDY8sggF4b2x5N3g3ZEZjTDA/view?usp=sharing

    There are two 'characteristics' or 'special feature' in this capx.

    First I had to check a range of Y values. Normally it hat to be enough to check if Y-position of the enemy is equal to the Y-position of the player. But if the player is fast enough it will not trigger this event, because the player is faster then 1 pixel per tick and will not hit this exact value. So I had to check a range.

    Second don't use mirror to turn your enemy. If you do the angle of facing will always 0° you have to use 'set angle'

  • I don't know how do you control the speed of your sprite, but you can do it like that:

    make a Instance Variable for your player, something like speed.

    then events and actions:

    System every tick -> player move forward player.speed

    Touch on touched player -> player add 1 to speed

  • That was my failure. It should collide and teleport to the other line. Problem was that it teleport in the line not behind or before so without the variable to do it only one, the sprite jumps back and forth. With variable it looked like it would not collide and to make it worse the cloned line was thicker than the one from the new made sprite. So it only teleport in the line of the cloned sprite.

    So it was my failure.

  • You have to use a global variable to have access to a value from every layout.

  • That is because your two following events. The second event will immediately overwrite the result of the first event if the value is above 2.

  • Maybe because you only look for less than 2 or greater 2 not for equal 2.

    If your variable is 2 nothing will happen. Same for zero.

  • I've tried to make some kind of tunnel with two sprites as a barrier for entrance and exit of the tunnel.

    These sprites are cloned. Now if the collisions of both sprites are enabled it doesn't work. Only if I disable one of the cloned sprite collision events or use a completely new sprite as trigger point, it works. Why doesn't it work with cloned Sprites?

    Example: drive.google.com/file/d/0B5FlDY8sggF4SkJjTDlPSFE1Rkk/view?usp=sharing

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Why don't you use a global variable or do I understand something wrong?

  • I don't get it to work either. It seems that calling "Set target Angle" after the tweening stops when the X is not in the range it makes the arrow snap if the X is again in distance.

    I get it to work without LiteTween if that will help you:

    I used "Rotate toward angel" and it works well.

  • You have to set "Rotate set Target angle" to absolute in your action not to relative. With relative you add up the angles, what gives you a completely wrong value.

  • Sorry, you are right. Execute from Browser is for execute Javascript as a string, not from a file.

    I tried CallJS and got also an error when I call it in on start of Layout. It seems that CallJS is to fast in execute the Javascript. So I add a Wait of 0.1sec from System before CallJS in "on start of Layout" and now it works.

    Maybe you have to alter the Wait-Time, but it seems that it works.

  • On the right side in the objects-tab. Choose your Box-Sprite and make a right Click on it. Click on Instance Variables and then on Edit (the little pencil) and change your value. This should apply to all Instance-Variables of this Object.

  • You have to import the Browser-Object and then use "Execute Javascript". That should work with "on start of Layout".