R0J0hound's Recent Forum Activity

  • Each condition filters the objects so I think if you add a "pick all" between each condition it should work. The object that "pick all" should use is the one the Sprite is overlapping with.

  • Another way would be to put the lists into text variables. Then use another variable to store a random value from 0 to 1, and if it's lower than 0.3 set the text to a random value from the first list, or if it's greater then that's the other 70%, so the other list would be used.

    Global text group1="cats,dogs,humans"
    Global text group2="cheese,meat,drinks"
    Global number probability=0
    
    Every 10 seconds
    --- set probability to random(1)
         probability<0.3
         --- set text to tokenat(group1, int(random(tokencount(group1, ","))), ",")
         Else
         --- set text to tokenat(group2, int(random(tokencount(group2, ","))), ",")[/code:2y22kkf8]
  • You could do it just as you describe without the pathfinder.

    Give the player sprite two variables: currentTarget=0 and goalTarget=0

    Then give the square sprite one variable: targetId and number each instance, starting with 0, in the direction the board goes.

    So the setup would be the player is placed on square 0. Then your events would look like this to move the player 5 spaces for example.

    On start of layout

    --- player: add 5 to goalTarget

    player: currentTarget < self.goalTarget

    square: targetId = player.currentTarget+1

    --- player: set angle toward position (square.x, square.y)

    --- player: move forward 100*dt pixels

    player: is overlapping square

    player: currentTarget < self.goalTarget

    square: targetId = player.currentTarget+1

    --- player: add 1 to currentTarget

    I didn't take into account wrapping around the board or centering on the square but it's got the general idea.

  • I'm not clear on what you're doing, but I think your formulas are off.

    If you're just moving with events and the joystick directly controls the speed do this:

    vx=Gamepad.Axis(0,0) * MaxSpeed
    vy=Gamepad.Axis(0,1) * MaxSpeed
    
    x= x+vx*dt
    y= y+vy*dt[/code:vtyzv8xa]
    
    If instead you want some acceleration when using the joystick do this:
    [code:vtyzv8xa]vx = vx + Gamepad.Axis(0,0) * acceleration*dt
    vy = vy + Gamepad.Axis(0,1) * acceleration*dt
    
    x= x+vx*dt
    y= y+vy*dt[/code:vtyzv8xa]
    
    or if you also want a max speed do this:
    [code:vtyzv8xa]vx = vx + Gamepad.Axis(0,0) * acceleration*dt
    vy = vy + Gamepad.Axis(0,1) * acceleration*dt
    
    speed = distance(0,0,vx,vy)
    
    if speed > maxSpeed
    {
    vx = vx*maxSpeed/speed
    vy = vy*maxSpeed/speed
    }
    
    x= x+vx*dt
    y= y+vy*dt[/code:vtyzv8xa]
  • [quote:2djp2t0v]I didn't use paster before. How much would it effect the performance?

    It's just drawing to a texture instead of the screen so it would be equivalent to drawing lots of sprites, or in the case of the example, 30.

  • Ah. I forgot to read the initial posting time.

  • To do that you just need to pick the other block to swap with. This is where the family comes in so you can pick two separate instances of the block. Basically create a family, call it "other" and add the block type to it. So for example if you wanted the block you click on to swap with the block to the right you could do this:

    global number tempx=0

    global number tempy=0

    on right clicked on block

    other: x = block,x+32

    other: y = block.y

    --- set tempx to block.x

    --- set tempy to block.y

    --- block: set position to (other.x, other.y)

    --- other: set position to (tempx, tempy)

  • I wouldn't download that dll. It's core to the windows operating system, if it's crashing then something is very wrong with your system. Have you tried upgrading your graphics card driver?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yes, you could use overlapping at offset and some picking with a family I suppose.

  • The canvas plugin is causing the cpu usage when webgl is on. Basically it has to copy the canvas to a texture every tick. If you disable webgl it's fast or alternately you could use the paster object instead.

    dellong

    Nice examples. I didn't think of using the circle for the rainbow, but it looks effective. The only issue you'll run into by fading the canvas like that is the images never fade away completely do to rounding, unfortunately there's nothing that could be changed to make it better. It's more noticeable on certain monitors or if you look at the screen from an angle. Still it's a good effect that I'll use again.

    bilgekaan

    If you're interested in existing solutions you can look here for one using sprites:

    viewtopic.php?f=147&t=164029&p=992930&hilit=trail#p992930

    It can be tuned to not use as many objects if performance becomes an issue.

    For trails with textures the paster object would need to be used.

    newt

    Paster's draw textured quad action handles this well, notion special needed to be done for repeating textures.

    /examples31/draw_path_paster.capx

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

  • You'll have to destroy and re-create the joints.

  • Here's a simplified capx that most of the time creates all the combinations without two of the same type next to each other. It uses an array that stores all the combinations with some text like "sprite:0". Then the array is shuffled by swapping values while trying to keep each two of the same type from being next to each other.

    https://dl.dropboxusercontent.com/u/542 ... ndom2.capx

    As far as moving the objects or using families, you can do anything you like there. All this does is create the objects. Think of the "create" function as a create action with a family as a parameter, only this follows your controlled random requirement.