Gamesalad actors
Gamesalad actors plus#
To add an image into the image library, select “Media” from the selection bar at the top and click “Add images and audio” or the plus sign. This can be useful if you want to assign an image to an actor later on or if you simply want to use an image as background media within your game. You can also add images that you’ve imported into the image library within your project. Next click the little plus sign and you’ve made a new Actor! To add an image to your Actor, simply drag an image file where it says “Drag an Image Here”. Next, select “Actors” from the selection bar at the top left (it’s the one that looks like a mask). Open up GameSalad Creator, and open up your project. 10 % 3 = 1.First, let’s take a look at an easy way to create an Actor with an image. % : Modulo is the remainder after dividing by a certain value. () : Parenthesis are used to perform all math functions within them before calculating with anything else. You can include an offset,(x’,y’), to find an angle relative to the offset. Input values less than 0 will result in ‘nan’.įind the angle relative to the origin, (0,0), given an X and Y coordinate. Tip: If you use the sine function and start your incrementing variable at 0(using the example above), your actor’s movement does not start at the middle between the minimum and maximum points of the wave. This is similar to the cosine function but it is offset by one quarter of a wave cycle.
Generate a random integer equal to or between the first integer value and the second integer value.Įxample: random(1,10) can be any number from the set of. Return the smaller value of two numbers or variable values. Return the higher value of two numbers or variable values. magnitude(x-x’,y-y’)Įxample: If I wanted to find the length between my actor at coordinates (25,30) and another actor at coordinates (100,240), I would use the expression magnitude(25-100,30-240). You can include an offset,(x’,y’), to find the length between the two points. The natural logarithm is the logarithm to the base e, where e is an irrational constant approximately equal to 2.718281828.įind the length of a line segment from the origin, (0,0), to the given point. The exponential function, e^x where e is the number (approximately 2.718281828). Check out other possibilities of sine and cosine at If the value that you use the cosine function on starts at 0, your resulting value will start at the maximum value of cosine. The trigonometric arctangent (inverse tangent) function. Any other input values will result in ‘nan’.
Values can only range from -1 to 1 with results from -90 to 90, respectively. The trigonometric arcsine (inverse sine) function.
Values can only range from -1 to 1 with results from 180 to 0, respectively. The trigonometric arccosine (inverse cosine) function. Usage Example: Combined with a cosine or sine function, you can make an actor “hop” in a pattern. make the number positive if it is negative. There are fifteen functions currently available: if they add it back to the main site and would like me to remove it just hola!! ? (This info was removed from the official site… it’s so handy I thought I’d add it here. Math/Trig Functions Reference for GameSalad