How do I attract objects to other

  • i need that spawned objects are attracted for this other...

    like asteroids. when they spawn, go in the spaceship direction.

    edit: i'm using the bullet behavior in the asteroids and custom movement in spaceship;

  • oh, and the asteroids rotate on their own axes.. therefore, i don't know how to do this

  • Calculate the angle from your asteroids X,Y values to the spaceships X,Y values. And use that angle in "Set angle of motion" (bullet behavior).

    I think you can use the expression "angle(x1, y1, x2, y2)" for that.

  • Calculate the angle from your asteroids X,Y values to the spaceships X,Y values. And use that angle in "Set angle of motion" (bullet behavior).

    I think you can use the expression "angle(x1, y1, x2, y2)" for that.

    I understand the idea, but what about that expression?

  • Something like this..?

    http://www.eli0s.com/Tests/SpaceShip.capx

  • Something like this..?

    http://www.eli0s.com/Tests/SpaceShip.capx

    the link is not working here :\

  • What do you mean it's not working? It downloads just fine on my part. Perhaps you have some antivirus or popup blocker in your browser?

  • What do you mean it's not working? It downloads just fine on my part. Perhaps you have some antivirus or popup blocker in your browser?

    no '-'

    perhaps my country is blocked? lol

    but the thing is.. i just want the spawned objects to go in my direction (the spaceship).

    any tips on this?

    just one more thing: how to, when i shoot, spawn 3 bullets with different direction? ex:

    1: 90 degrees

    2: -15 compared to the first

    3: +15 compared to the first

    sorry for the 'truck' of questions hehe

    ..and sorry for the english :b

  • pm your email, I'll send you the file, it will be so much easier if you see the capx... Otherwise for the first part 5Type basically already covered it in terms of code, you have to dig a little into expressions...

  • pm your email, I'll send you the file, it will be so much easier if you see the capx... Otherwise for the first part 5Type basically already covered it in terms of code, you have to dig a little into expressions...

    yup.. i've started to learn construct and basics of programming recently.

    my email is nhsombra@gmail.com

    here is my attempt to do the 3 shots thing: https://db.tt/cUf1UJDm

    when the spaceship starts to turn, start the error..

  • Please check your email.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 1) You have to set the parameter "Set Angle" to No on the Bullet Behavior. This is braking the set angle of motion.

    2) You must FIRST spawn the bullet and AFTER set the angle of motion.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)