dop2000's Recent Forum Activity

  • 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

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

  • Try Construct 3

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

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

dop2000's avatar

dop2000

Member since 26 May, 2016

Twitter
dop2000 has 256 followers

Connect with dop2000

Trophy Case

  • 8-Year Club
  • Entrepreneur Sold something in the asset store
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Forum Wizard Made 5,000 posts in the forums
  • Forum Unicorn Made 10,000 posts in the forums
  • x5
    Popular Game One of your games has over 1,000 players
  • x2
    Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • Enduring Visitor Visited Construct.net 90 days in a row
  • Unrelenting Visitor Visited Construct.net 180 days in a row
  • Continuous Visitor Visited Construct.net 365 days in a row
  • RTFM Read the fabulous manual
  • x3
    Quick Draw First 5 people to up-vote a new Construct 3 release
  • x13
    Great Comment One of your comments gets 3 upvotes
  • Delicious Comment One of your comments gets 10 upvotes
  • Email Verified

Progress

28/44
How to earn trophies