Trying to make my litte pixies hover

Danfisher

  • Posts: 36
Hi Folks,

I have some pixies in my game that I would like to hover in the air like...well, pixies.  Essentially, I just need them to buzz randomly back and forth and up and down around a particular point.  So far, all I've been able to get them to do is to fly off the screen in various directions.  I've attached a screenshot of my "hover" behaviour which I created.  Tips from more experienced Stencyl-ers appreciated!

LIBERADO

  • *
  • Posts: 2720
Is this what you want?:

<a href="http://www.filz.us/files/8b919ff0/1cc/PIXIES.swf" target="_blank" class="new_win">http://www.filz.us/files/8b919ff0/1cc/PIXIES.swf</a>

« Last Edit: June 16, 2015, 08:24:21 pm by LIBERADO »
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

Eriko

  • Posts: 162
I'm interested.

Danfisher

  • Posts: 36
Liberado, that's exactly what I want, except without any triggering event (eg. mouse over) required.  I just want them to "hang" in a general area and then I'm going to code them to shoot little blasts from their wands (but that comes later...).  How would you code pixies to move automatically in a 20 pixel by 20 pixel area randomly, but constantly?

LIBERADO

  • *
  • Posts: 2720
1st.- Install the EasyMath extension: http://community.stencyl.com/index.php/topic,27769.0.html

2nd.- Add to each pixie actor the code shown in the image attached at the end of this post.

3rd.- For a fixed area, replace the "x of mouse" and "y of mouse" blocks with the values of the coordinates of the desired area.

4th.- You can change the value of the "set actor value [RADIUS] for [Self] to..." block, currently it has a value of 15. For an area of 20 by 20 I think a value of 5 could be appropiate.

« Last Edit: July 06, 2017, 06:55:44 pm by LIBERADO »
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

Blaziken8x

  • Posts: 192
There are "Back and forth Horizontally" and "Back and forth Vertically" behaviors in stencyl, you could try using those. (they make the actor move left and right or up and down)
   

Danfisher

  • Posts: 36
Awesome ideas, guys.  Thanks so much for the help!