Creating a line between two active points

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • I've built a small game engine on Flash recently and was looking to produce a similar effect on MMF2 as I'm hoping to eventually make an iOS game using it.

    I have two points which are active objects. What I'm trying to do is constantly create a line (active object) running between these two points. I worked out a formula for the basic length that a small active object (being used to replicate the basic line) will be stretched to in order to stretch from the first point to the second, using Pythagoras theorem and the x,y values of each point but I am unable to work out how to be able to get this active object line to rotate to be able to run smoothly from the center of one active to the other.

    Any help would be greatly appreciated. :)

  • Place the Clickteam Movement Controller in the frame.

    Make the AO called "Line" 3 pixels wide and put the hotspot to the left.

    * Always
    - Line: Set Position relative to Point A
    - Line: Set X Scale to DistObjects("Clickteam Movement Controller", Fixed("Point A"), Fixed("Point B"))/3
    -
    Line: Set Angle to
    AngleObjects("Clickteam Movement Controller", Fixed("Point A"), Fixed("Point B"))

    Set display mode to Direct3D for smoothest result.

  • Or without extensions:

    Make an active object called "Line" 1px wide with a height of the thickness of the line you want.

    * Always
    - Line: Set Position relative to Point A
    - Line: Set X Scale to sqr((Y("Point B")-Y("Point A")) pow 2 + (X("Point B")-X("Point A")) pow 2)
    -
    Line: Set Angle to atan2(Y("Point A")-Y("Point B"),X("Point B")-X("Point A"))

    For a list of my achievements, hit up Please login to see this link..com/
    Unless you want to party, then go to Please login to see this link.

  • Change
    - Line: Set X Scale to sqr((Y("Point B")-Y("Point A")) pow 2 + (X("Point B")-X("Point A")) pow 2)
    to
    - Line: Set X Scale to min(sqr((Y("Point B")-Y("Point A")) pow 2 + (X("Point B")-X("Point A")) pow 2),[MAXIMUM VALUE])
    for example,
    - Line: Set X Scale to min(sqr((Y("Point B")-Y("Point A")) pow 2 + (X("Point B")-X("Point A")) pow 2),500)

    For a list of my achievements, hit up Please login to see this link..com/
    Unless you want to party, then go to Please login to see this link.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!