Curves?

RosalinaGalaxer

  • Posts: 239
Hey,

I've been looking into getting actors to move along curves. The block LIBERADO made no longer works with 4.0, so I'm at loss as how to go about doing this. Does anybody have an idea as to how this should work?

Thanks.
Ģ̷̓l̴̥̒͑̕͝ì̷̘͈̬͈̖̂͂̔̕t̷͔͇̯̥̬̀̽̓͜͝c̵͇̦̼̮̉̐̈́̕͝ͅͅḣ̵̡̫̞͚̐̅ͅë̶̗̦̪̖͚̜́͊̄͑s̵̺̹̖̼̥̃.̴̮̫͐ ̶̛̓̇̾̎

“I have never seen a more heated discussion about context, jazz, and cats.” - VanillaButterz


RosalinaGalaxer

  • Posts: 239
It doesn't work on my end at the very least. There were also people in the forum with the bezier curve block who said that Stencyl's tweening library changed, and that the bezier curve block doesn't work anymore.
Ģ̷̓l̴̥̒͑̕͝ì̷̘͈̬͈̖̂͂̔̕t̷͔͇̯̥̬̀̽̓͜͝c̵͇̦̼̮̉̐̈́̕͝ͅͅḣ̵̡̫̞͚̐̅ͅë̶̗̦̪̖͚̜́͊̄͑s̵̺̹̖̼̥̃.̴̮̫͐ ̶̛̓̇̾̎

“I have never seen a more heated discussion about context, jazz, and cats.” - VanillaButterz

RosalinaGalaxer

  • Posts: 239
Could somebody test the code/blocks in the below code to see if it works? I tried it myself, and it didn't really work, but I think I might have made a mistake somewhere.

You should be able to alter the angle by multiplying the part [absolute value of(blahblah)]. The more you multiply it, the higher angle it will be, though it will never be 90 (it would require x to be set to 0). Moreover, if the angle would be 90, the bullet would never corrected it's velocity toward the enemy.

Since the last post I have figure out it will probably be a little bit better if you put distance in attributes. Easier to read and only calculated once (x distance was calculated twice). So, together with the multiplier it would be something like that:

Code: [Select]
set xDistance to [x of enemy] - [x of self]
set yDistance to [y of enemy] - [y of self]
then the velocity block with atan2(yDistance - ([absolute value of xDistance] * multiplier), xDistance)
You can use whatever number as multiplier, 1 will get you the same result as without it (obviously), higher number should make the initial angle higher and number between 0 and 1 should make it lower.


From this forum thread.
Ģ̷̓l̴̥̒͑̕͝ì̷̘͈̬͈̖̂͂̔̕t̷͔͇̯̥̬̀̽̓͜͝c̵͇̦̼̮̉̐̈́̕͝ͅͅḣ̵̡̫̞͚̐̅ͅë̶̗̦̪̖͚̜́͊̄͑s̵̺̹̖̼̥̃.̴̮̫͐ ̶̛̓̇̾̎

“I have never seen a more heated discussion about context, jazz, and cats.” - VanillaButterz