R0J0hound's Recent Forum Activity

  • New update on first post.

    New R4:

    [Fix] Now works with WebGL. (thanks to Yann)

    [Add] Additional hotspot locations top-right,top, etc...(thanks to Yann)

    [Add] Paste Layer action(thanks to Yann)

    [Change] Paste object/layer action now only paste visible objects.

  • A little bit of info:

    System: abs(player.x-enemy.x) < distance

    That only compares the first picked "player" and "enemy" objects' values.

    foreach enemy
    System: abs(player.x-enemy.x) < distance

    This compares each enemy against the first picked instance of the player.

    enemy: abs(player.x-enemy.x) < distance

    Now the "pick by comparison" that CC has is like the "system compare" with these differences:

    1. Corresponding picked instances are used for expression values.

    ex:

    The first picked enemy is compared with the first picked player,

    the second with the second,

    the third with the third... and so forth.

    If the amount of picked objects differ in count for example: 2 players and 4 enemies it will loop back to the first.

    ex:

    The first picked enemy is compared with the first picked player,

    the second with the second,

    the third with the first,

    and the fourth with the second.

    2. The enemy objects are picked.

    I'd also like to point out these apply to picking in general with most object conditions.

    Now for the workarounds until "pick by comparison" is added.

    Since I assume there will be one player and many enemies Yann's second solution will work fine. I've also used private variables to do the same thing:

    Every Tick-> enemy: set dist to abs(player.x-enemy.x)

    enemy: dist < distance -> do stuff

  • It's done just as you describe. Give the player and obstacles the physics behavior, and apply forces to the player to make him move.

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

  • Until it is properly implemented as a condition you can do it yourself with events.

    <img src="http://dl.dropbox.com/u/5426011/examples%208/pick_topmost.png" border="0" />

  • You don't have to use matrices, just some trig will work. The hardest bit is probably the depth sorting.

    /examples%208/carousel.capx

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

  • None of those errors are related to c2. The relevant error would be at the bottom of the list, but if there was an error the level would be grey not white. Did you add anything to your new layout? C2 previews on the currently selected layout, so if you didn't add anything you will just see an empty white layout.

  • Sprite2's position is not being repositioned in your repeat loop so when it overlaps with the wall it overlaps through the entire loop, moving 20 pixels. To fix it put a action to position Sprite2 to Sprite in the loop.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It works if you put your events in the same order as it is in my post. Events are evaluated from the top down.

  • Give the wagon two variables "oldx" and "oldy", then the events are as follows:

    + System: Start of layout

    -> wagon: Set 'oldx' to .X

    -> wagon: Set 'oldy' to .Y

    + Sprite: Sprite overlaps wagon

    -> Sprite: Set position to .X+wagon.X-wagon('oldx'), .Y+wagon.Y-wagon('oldy')

    + System: Always (every tick)

    -> wagon: Set 'oldx' to .X

    -> wagon: Set 'oldy' to .Y

  • The speed can be calculated with:

    sqrt(Sprite('vx')^2 + Sprite('vy')^2)

    or with physics:

    sqrt(Sprite[Physics].VelocityX^2 + Sprite[Physics].VelocityY^2)

    Height is just the distance from the bottom of the screen:

    480-Sprite.Y

    Here are some resources:

    physicsclassroom.com/class/vectors

    en.wikipedia.org/wiki/Kinematics

    en.wikipedia.org/wiki/Projectile_motion

    en.wikipedia.org/wiki/Trajectory_of_a_projectile

    en.wikipedia.org/wiki/Euler_method

  • Move the sprite 1 pixel down, check for overlap with ground then move the sprite back up.

    every tick:

    ----Sprite| set isInAir to true

    ----Sprite| set Y: y+1

    Sprite| is overlapping ground:

    ----Sprite| set isInAir to false

    every tick:

    ----Sprite| set Y: y-1

R0J0hound's avatar

R0J0hound

Member since 15 Jun, 2009

Twitter
R0J0hound has 157 followers

Connect with R0J0hound