Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - Benk10

Pages: 1
Ask a Question / Using Git with Stencyl
« on: May 08, 2016, 06:33:45 pm »
Hi everybody,

Is it possible to use Git or any other version control system with Stencyl projects?

Ask a Question / Flashing actor doesn't work
« on: May 06, 2016, 02:41:26 pm »

I almost feel bad asking this since the problem is likely very simple, but I haven't solved it.
I want to make an actor flash when respawned. My code is:

repeat n times
    fade last created Actor to 0% over 0 sec using none
    do after s seconds
        fade last created Actor to 100% over 0 sec using none

I've attached the whole respawn event. It creates the player in the center of the screen, makes it temporarily invulnerable, and is supposed to flash the player.

Ask a Question / can't spawn large objects off screen
« on: May 04, 2016, 10:47:05 pm »

I'm making an Asteroids clone and I've got small, medium, and large asteroids. I'm working on the spawning behavior now. Small asteroids spawn off-screen just fine but big ones don't even though the logic is exactly the same.  They can all spawn in-screen. The asteroid sizes are about  16x32, 32x64, and 64x128 pixels, if that's relevant.

Any ideas why this is happening?

Ask a Question / Surface normals vs x/y normals
« on: November 14, 2014, 12:53:53 am »
In physics, a surface normal is simply a vector that is perpendicular to the surface.
Stencyl includes "x-normal" and "y-normal" blocks under Collision -> Collision Points, which need to be used with the "For Each collision point" loop.
However, I doubt these are surface normals. Have a look here:
This seems to say that these normals in box2D are not surface normals but are rather vectors indicating where and in which direction impulse should be applied to most efficiently  separate objects in contact. This may not necessarily be a surface normal.
So if the x/y normals in Stencyl are the same as these box2D normals, they are NOT surface normals!

So then, how do I find out the surface normal? I need to know this to implement beam refraction.

Suggestion Archives / Allow sensors to detect sides
« on: November 13, 2014, 11:26:58 pm »

For some reason you cannot use "the top/bottom/left/right of actor was hit" with sensors. This is quite counter-intuitive - it means the sensor doesn't sense where a hit occurred - and also makes it difficult/impossible to implement things that would otherwise be easy to do.  For example, suppose you want an actor to pass through a block but different things happen depending on which side it passed through. It really makes no sense that this part of collision logic doesn't work with sensors, which otherwise detect collisions normally.  Please fix this.

update: It also appears that "for each collision point" doesn't work either.

Ask a Question / Get direction component of velocity before collision
« on: November 11, 2014, 11:10:31 pm »

I just started  using Stencyl and this is my first post.

tl;dr: skip to the Update below

I am making a laser simulator with basic optics (at least the stuff that can be done with particle-based approximations).  Right now my "laser" shoots only one photon upon a key press, just to keep things simple. I built a beam splitter actor. In real life these are typically placed 45 degrees relative to the beam and allow half the beam through and the other half reflects at 90 degrees relative to the original beam. In Stencyl, the reflection part is done automatically by the built-in physics engine and the transmission part can be faked by spawning a new photon actor with no collision box at the collision point and pushing it in the direction the original photon was moving upon collision.

Trouble is, the direction of "last collided Actor" isn't what I expected it to be. The photon travels straight up, hits the splitter, and reflects as it should.  However, a print statement reveals that the "direction of last collided Actor" is not up but is rather 0, regardless of the beam splitter's orientation.

 What's going on here?

UPDATE: Apparently I got confused between the direction of an actor (which way it is facing) and the direction component of an actor's velocity (which direction it's moving in). The latter is what I need. How do I get it?
There does not seem to be a getter for this in the event block palettes, even though there is a setter for it. Can I get it with code? Can I create my own palettes so I can make this missing pallette?

UPDATE 2 See 2nd to last post on this thread:,4730.15.html
This is how to get the direction component of velocity. There really ought to be a simple "Get direction (velocity)" palette.
But now there is a new problem:  The direction of last collided actor gives me the direction that the original photon reflects towards AFTER the collision, not its direction at the moment of the collision, which is what i expected to get. I want the latter. How do I do that?

Pages: 1