R0J0hound's Forum Posts

  • epicjelly

    r169 is the latest beta. A link to it is on the center of the bottom of the page, right above the total downloads counter.

  • The math is simply positioning the objects on a circle.

    x = center.x+ radius*cos(angle)

    y = center.y+ radius*sin(angle)

    Only it's from the side so y doesn't change. With it you can calculate z for sorting if you like later.

    x = center.x+ radius*cos(angle)

    z = radius*sin(angle)

    That is the basic formula for positioning objects. You change y like in any other game and you change the radius and angle to calculate the x position. The scaling can be done with the sin() function. Notice the value of sin() at these angles:

    sin(0) =0

    sin(45)~=0.707

    sin(90)=1

    sin(135)~=0.707

    sin(180)=0

    It looks like it would work well to set the width to BrickWidth*sin(angle). With it the bricks will be full width when facing head on (90 degrees) and will disappear to a sliver as it turns. Well, it will also be full width when facing away (270 degrees) but we can hide them when the z is less than 0 to hide that. Also keep in mind changing the width is only necessary for the wall bricks, the platforms just change position in the game.

    Here's a capx with just the bricks:

    https://www.dropbox.com/s/nnoeswz440ur1 ... .capx?dl=1

    The bricks are placed in a circle taking into account the tower's radius and how many bricks you want per layer. From that we can find how wide each brick should be and the angle difference from one brick to another.

    First calculating the brick width is simple enough. We just take the length around the tower (or the circle circumference) and divide it by the number of bricks in a layer.

    Circumference = 2*pi*radius

    BrickWidth = 2*pi*radius/numBricksPerLayer

    NOTE: The I'd like to point out that the "BrickWidth" above and the one in the expression to set the sprite's width is different from the sprite's actual width.

    Next calculating the angle of one brick to another is even simpler. Just divide 360 by the number of bricks per layer.

    Finally the loop to create a ring of bricks would look like this:

    start of layout

    --- set brickwidth to 2*pi*radius/numBricksPerLayer

    ----- repeat numBricksPerLayer times

    -------- create sprite

    -------- set sprite.r to radius

    -------- set sprite.a to loopindex*360/numBricksPerLayer

    Anyway that's most of the math you'd end up using.

    -cheers

  • For a quick solution using

    http://simpleweatherjs.com/

    you can do this:

    https://www.dropbox.com/s/jtwuivwa9cia8 ... .capx?dl=1

    /examples22/weather.capx

    No temperature maps though, for that there are some other libraries that appear to require a signup to use and are only free up to a certain amount of uses per day.

  • eli0s

    It's a limitation of the flood fill algorithm used. To be able to fill those gray pixels too would require an algo that fills pixels whose colors are close to the original by a threshold.

    PopperOfCorn

    It's a known bug when webgl is on. It works if webgl is off, but other than that I don't have a fix for this plugin. However look at the Paster plugin as it works there.

  • In the editor you don't have access to any html5 stuff, only what's listed here:

    https://www.scirra.com/manual/21/the-edit-time

    You can draw colored and textured quads with that so you possibly could do more than just wireframe. The rendering engine in the editor is just 2d though.

  • irina

    From the C2 manual:

    https://www.scirra.com/manual/126/system-expressions

    [quote:3dttumq0]CanvasToLayerX(layer)

    CanvasToLayerY(layer)

    Calculate the layout co-ordinates underneath a position in canvas co-ordinates for a given layer.

    LayerToCanvasX(layer)

    LayerToCanvasY(layer)

    Calculate the canvas co-ordinates above a position in layout co-ordinates for a given layer.

  • irina

    For the first capx the issue is the layer scales aren't considered currently.

    The second capx is the same. So moving the objects is a solution or you can maybe look into the system expressions to convert layer positions to screen and vise versa.

  • zixofranic

    There isn't really any documentation but the are descriptions in the editor when adding expressions, actions or conditions.

    For a coloring book you want a paint bucket fill like mspaint right? Look at the "floodfill canvas with color" action to do that.

    However the only limitation with that is Just make sure the canvas is completely opaque, aka has no transparency. Transparency can cause the flood fill to hang the game currently.

  • So it's like a triangle formation. If you disregard centering you can visualize the placement of the nth follower with:

     1  3  6 10 15
     2  5  9 14
     4  8 13
     7 12
    11[/code:12i2572a]
    
    I don't see any good patterns that we can make a formula with but I can see a pattern with the follower number and it's column:
    [code:12i2572a]num:  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15
    col: (1)(1  2)(1  2  3)(1  2  3  4)(1  2  3  4  5)[/code:12i2572a]
    So we can do it with a loop:
    
    number n=1
    number column=1
    for each follower
    --- follower: set col to column
    --- add 1 to column
    ------- if column >  n
    ---------- add 1 to n
    ---------- set column to 1
    
    So with that you can set the followers x position with leader.x + 64*follower.col.
    
    Then if you loop through each column of followers you can set the y position and even center them vertically.  See example for detail:
    [url=https://dl.dropboxusercontent.com/u/5426011/examples22/squad.capx]https://dl.dropboxusercontent.com/u/542 ... squad.capx[/url] 
    
    The simplest way to position relative to the leaders angle is to use "move at angle" instead of set x and y.  Again see example for detail.
  • Here's the equations for that.

    X=distance*cos(angle)

    Y=distance*sin(angle)

    But this is an angle and distance from the origin (0,0), usually you want the position (x,y) an angle and distance from another position (x0, y0).

    X=distance*cos(angle) +x0

    Y=distance*sin(angle) +y0

  • Snowmane

    You can set the clipboard with the nodewebkit object if you export or preview with nodewebkit. There isn't a way to set the clipboard otherwise. You could look through the platform specific plugins and see if any others have clipboard actions but I imagine not. The clipboard is mainly a win/linux/mac thing.

  • Here's an instantaneous way to plot the path:

    It doesn't take into account collisions though. For that your current method is the only solution atm.

  • One idea is to use a text list and use and remove one item at a time.

    global text frameList=",0,1,2,3,4,5,6,7,8,9,10,11,"

    global number randFrame=0

    Start of layout

    For each sprite

    --- set randFrame to tokenat(frameList, random(1, tokencount(frameList, ",")), ",")

    --- set frameList to replace(frameList, ","&randFrame&",", ",")

    --- sprite set animation frame to randFrame

    Another idea that equalizes eventually is:

    repeat 12 times

    Sprite animation frame is loopindex

    system compare sprite.pickedcount > 1

    --- sprite set animation frame to int(random(12))

    Or if you want to make it work in one tick you can do this:

    global number unique = 1

    while

    unique=1

    --- set unique to 0

    ------ repeat 12 times

    ------- Sprite animation frame is loopindex

    ------- system compare sprite.pickedcount > 1

    ---------- sprite set animation frame to int(random(12))

  • Maybe use a loop?

    global number radius=1000

    global number num =100

    Start of layout

    Repeat num times

    --- create object planetoids at (sun.x+radius*cos(loopindex*360/num), sun.y+radius*sin(loopindex*360/num))

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • The value you get from the bullet's angle of motion expression is in the range of -180 to 180, which still is a range of 360 degrees and still works with most all angle ACEs. If you want to convert it to the range of 0-360 do this:

    (ang + 360)%360[/code:3ofxclp9]