dop2000's Forum Posts

  • Sorry, I still don't understand your question.

    You need to populate this array? Should these locations be predefined on each level? Or are they generated on random?

    If predefined, you can read them from a file, say, using CSV plugin.

  • So do you still have the second problem with "Trigger once"? If you do, please share a screenshot of your events.

  • You can try adding Platform behavior to the box, disable standard controls.

    Enable collisions for your Player sprite.

    Then do something like this:

    It works, but requires some tweaking.

    You can slow down both the player and box, disable any animation changes while the box is being pushed etc.

  • Here is a very primitive example, works with rectangular shapes with Origin point set to (0,0) :

    SmallSprite Compare X if less than BigSprite.x  -> SmallSprite Set x to BigSprite.x
    Compare two values -> SmallSprite.BBoxRight>BigSprite.BBoxRight  -> SmallSprite Set x to (BigSprite.BBoxRight-SmallSprite.width)[/code:2snzegm8]
    (similar code for Y coordinate)
    
    If your sprites have complex shapes, there are several things you can do.
    If partial overlapping is ok, you can save SmallSprite position in instance variables oldX and oldY on every tick. If on next tick the sprite moves and no longer overlaps the BigSprite, return its position to oldX, oldY.
    
    Or you can pin a few very small invisible sprites to the corners of the SmallSprite, lets call them detectors. If any of the detectors is not overlapping the BigSprite, return SmallSprite to its previous position. 
    Or you can use the same principle with image points and "Pick overlapping point" event.
  • newt

    Wow, didn't think of that! Great idea, I'm going to use it in my game too.

  • This code should work if ANY instance has boolean set:

    
    ************************************|Sprite -> Is boolean b set        |  do something
    |System- > Trigger once while true |
    x----------------------------------x[/code:1mpcjwqr]
    
    And it will only be triggered once. If after that you set boolean to other instances, it will not be triggered again.
    If you reset b to false for all instances, and then set one to true, it will be triggered again.
  • No worries!

    I just realized that the blue CarCollision sprite is not necessary in the last example. You can replace it with Car in all events, then delete.

  • Christmas

    Ok, an improved version, should work as you described:

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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Glad it helped!

  • I fixed it <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

    https://www.dropbox.com/s/34dycek87zrwi ... .capx?dl=0

  • I haven't used them myself, but I believe you can draw your colored dots on a Canvas or Paster object. This way you'll have only one object, not hundreds.

  • Something like this maybe?

    System->Compare two values-> abs(angleDiff(player.angle, enemy.angle))>90

  • Make an invisible sprite the size of the car (or a bit bigger for better touch control).

    Add Drag & drop behavior to this sprite. When the sprite Is Dragging, set the car to sprite position, but only if the sprite is not overlapping walls.

    You can pin two invisible sprites together - a bigger one for dragging and a smaller for overlapping checks.

    Also I think you should disable Physics on the car while it's being pulled. Re-enable it when it's released.

  • Try Canvas or Paster plugins:

  • There are a couple of plugins you can try:

    Canvas has an expression rgbaAt, which, I'm guessing is what you need.

    As for changing sprite color, maybe you can use "Set color" effect?