
We could have used “-3” too (3 pixels to the left).

However, you can also use block 1 to move your actor in a specific direction, using the “X-of-Self” we discussed earlier and some math:ĭo you see what happened? We looked at the x-position of the actor and moved him over “+3” (3 pixels to the right). It sets the actor’s position at the specified (x,y) point: You can combine the two planes, of course, to do something like push up and right at the same time. Experiment though, and see what works for you.Īgain, the x and y field specify direction: If you push only once (a pitcher does not continue to push a baseball with his hand once it has left his hand), try using “sharply”. If you keep pushing from frame to frame, try using “gently”.

The main difference is the time over which the force is applied.

Setting x-speed and y-speed follow the same schematic mentioned above. For block 2, give your actor a speed and he will move in the specified direction. If you try to move it into an object or tile, Stencyl may catch that and adjust the actor’s position for you though. Simply put, they return the x/y position of your actor (by default, the topleft or origin of your actor) and the x/y speed of your actor:įor block 1 above, simply fill in the x,y coordinates and it will try to move the specified actor to the position given. You can also get related positional and movement data from the following blocks, found in the same areas mentioned above. The BASIC blocks for each action are seen below. Push the actor with a force in a specific direction (Found under Actor > Movement).Set the actor’s speed in a specific direction (Found under Actor > Movement).Set the actor at a specific (x,y) coordinate (Found under Actor > Position) In Stencyl, you have three different ways of moving your actor. We are saying that the bottom-right pixel is 399 pixels to the right of and 199 pixels below our origin. This is because we started at (0,0) and not (1,1) at the top-left. You can also move up and left from (0,0) for negative values, though actors at such positions may not be visible.Īs an example, if your screen width is 400 pixels and your screen height is 200 pixels, then the bottom-right pixel of your screen will be (399, 199). The top-left pixel is (0,0), also know as the origin. Each pixel is an (x,y) point on your game screen when at a normal x1 resolution. In Stencyl, positioning is done by coordinates.
#Stencyl resolution how to
What we’re learning: How to move your actors around effectively keeping multiple position/movement blocks from fighting each other.

This is a “Stencyl For Noobs” guide! Take 5-10 minutes to go over this guide for a better understanding of the topic at hand!
