R0J0hound's Recent Forum Activity

  • I was going to say that you would need to use events for that but then I found a solution:

    for i in range(5):
       System.Create("chain", 1, Sprite.X + i*32, Sprite.Y)
       SOL.chainPhysics.DisableCollision("Sprite")
       if i == 0:
          SOL.chainPhysics.HingeToObject("Sprite",0,0)
       else:
          prev_chain.HingeToObject("chain",0,0)
       prev_chain=SOL.chainPhysics[0]

    It attaches the first link to the sprite object.

  • Try

    execfile(System.AppPath + 'Data\py\array.py')

    or

    exec(open(System.AppPath + 'Data\py\array.py'))

    instead.

  • This will work just like zeropad(n,8):

    left("00000000", 8-len(str(n))) & n

  • Here is a basic way to do it:

    Every Tick:

    + Sprite: set X to: Sprite.X + 1

    Sprite: is overlapping Wall:

    + Sprite: set X to: Sprite.X - 1

    If the motion is more complex another way to do it would be to save the sprite's x,y position in variables before moving the sprite. Then if it collides with a wall you can undo the motion by setting the sprite's position to the values in the variables.

  • I haven't opened your capx but here's an idea to do the sliding of the tiles.

    1. When you start dragging store the start position, and the x,y distances to the empty space.

    For example if the tiles are spaced every 100 pixels:

    empty above: x,y distances= 0, -100

    empty below: x,y distances= 0, 100

    empty left: x,y distances= -100, 0

    empty right: x,y distances= 100, 0

    2. Then while dragging contain the tile's position from the start position to the x,y distances.

    ex for x:

    start_x + clamp( Mouse.X - start_x, min(0, x_distance), max(0,x_distance))

    3. On the end of the drag just snap the tile to the grid.

    Example capx:

    http://dl.dropbox.com/u/5426011/examples%208/9tile.capx

  • Doesn't the "rgbaAt" expression do the trick?

    There are other implementations of flood fill that don't use recursion:

    http://en.wikipedia.org/wiki/Flood_fill

    Here I used the array object to implement a queue to keep track of what points to fill next.

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

    /examples%208/floodfill.capx

  • Try this:

    + Sprite2: is on ground

    -> Sprite2: Set 'canUseJetpack' to 0

    + Sprite2: Pick by Sprite2[Platform].VectorY Greater than 500

    + Sprite2: is falling

    -> Sprite2: Set 'canUseJetpack' to 1

    + Sprite2: Value 'canUseJetpack' Equal to 1

    + MouseKeyboard: Key Z is down

    -> Sprite2: Set vertical speed to Sprite2[Platform].VectorY-6000*timedelta

  • An erase action is not possible, globalCompositeOperation is set by the object being pasted. To do an erase effect, you would have to set the effect of the object you're pasting.

    Sprite: set effect to "destination out"

    Canvas: Paste "Sprite"

    Sprite: set effect to "none"

  • This works using python to access the winapi:

    http://dl.dropbox.com/u/5426011/examples%208/getIco.zip

    Note: The transparency of the icon is not preserved with this method.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It looks like you used "Copy collision mask to each frame". It is currently broken and causes the collision mask of every frame to be empty.

    An oft used solution is to have a separate sprite for the collisions. Any behaviors are applied to the hitbox sprite, and player sprite's position, direction and animations are set with events.

    The events will look like this:

    + System: Always (every tick)

    -> Sprite: Set angle to hitbox.Angle

    -> Sprite: Set position to object hitbox (image point 0)

    + hitbox: [negated] is moving

    -> Sprite: Set animation to "idle"

    + hitbox: is walking

    -> Sprite: Set animation to "running"

    + hitbox: is falling

    -> Sprite: Set animation to "falling"

    + hitbox: is jumping

    -> Sprite: Set animation to "jumping"

  • You need to manually move the platform so the player can be moved with the same amount as the platform.

    Here's one way to do it using a dummy sprite. The motion is applied to the dummy sprite, then if the player is overlapping the platform move the player with the change of the dummy's position and then move the platform to the dummy's position.

    http://dl.dropbox.com/u/5426011/examples7/vertical_platform.capx

  • Try this for setting text to a number to two decimal places:

    int(num) & "." & int(num*100)%100

R0J0hound's avatar

R0J0hound

Member since 15 Jun, 2009

Twitter
R0J0hound has 155 followers

Connect with R0J0hound