R0J0hound's Recent Forum Activity

  • 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.
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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))

  • 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]
  • Ashley It only occurs when not using webgl. In the sprite plugin it has the function "preloadCanvas2D" that draws all the animation images to the canvas on load. You can see it in any project if you set "Enable WebGL" to off, "Clear Background" to no and make the bottom layer transparent. So when the load is quick you will never see them since it will be overdrawn.

  • You could try the canvas.rgbaAt(x,y) expession... or use the blueAt(), redAt() and greenAt() expressions to get the color components to build a color string like "rgb(0,255,255)".

  • The flood fill action seems to hang when there is transparency in the canvas being filled. Also the other color names work as I recall in Firefox. But in chrome they don't seem to be, but using color strings like "rgb(0,255,255)" do work.

R0J0hound's avatar

R0J0hound

Member since 15 Jun, 2009

Twitter
R0J0hound has 157 followers

Connect with R0J0hound