C. Dev's Recent Forum Activity

  • You do not have permission to view this post

  • You do not have permission to view this post

  • you can use itch.io

  • You’ll have to refer to the documentation for how to do it.

    Basically you’d access the runtime object, find the list of object types from that, then a list of each instance for each type. Then you can either compare the x y or calculate the distance with:

    var dx=x1-x0, dy=y1-y0

    Math.sqrt(dx*dx+dy*dy)

    Or maybe the sdk has a distance function you can use. Anyways that’s the gist of it.

    Thanks!

  • Is it possible to get the X and Y coordinates + distances from other objects using a behaviour?

  • Posting in Scripting section to retrieve more relevan answer to your question.

    Why? Isn't this the Plugin SDK?

  • If there are more than one type of solid object, you will likely to create Family and add those solid as member. Let's name the family class "solid_family". Then set condition > system > compare between two values > distance(Sprite.X, Sprite.Y, solid_family.X, solid_family.Y) less or equal to 10. Proceed to action and execute what you want to do when condition met.

    And for 8-directions behavior you need to specify certain condition that will trigger an action. For the action part simply pick simulate control and choose control: Right.

    I mean using js...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi,

    I want to check if there is a solid object in the range of 10px using a behaviour.

    And I also want to ask how I can trigger (f.e. if the 8-direction behaviour is added) that the object moves to the right!

    Thanks!

  • Got it to work now, thanks!

  • This question has come up a couple of times so I've added a new DOM Messaging plugin sample to the plugin SDK download here: https://www.construct.net/en/make-games/manuals/addon-sdk

    It uses DOM messaging to set and get the document title, since that is a simple DOM API that can't be used in a worker.

    Thanks very much!

  • Moved to Plugin SDK forum.

    See the section on DOM calls in the Addon SDK documentation.

    Im not a 100% sure how I can use DOM calls to use window in worker mode?

  • Are you using the addon SDK to write a plugin, or using Construct's scripting feature? This is the forum for the latter, but you mentioned a plugin.

    I use the addon SDK

C. Dev's avatar

C. Dev

Member since 20 Feb, 2021

None one is following C. Dev yet!

Trophy Case

  • 3-Year Club
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

6/44
How to earn trophies