Yann's Forum Posts

  • +Keyboard: On Up arrow pressed
    +Sprite: Is overlapping ground at offset(0,1)
      -> Sprite: Set Physics impulse (0,-2) at image point 0
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • aridale

    I don't think that a combi texture would work, because you'd have to take into account all possible combinaison of height between the seethrough wall and the wall behind...

  • Ok this time I think it's a real bug

    After some tests, if I make a 'OR' block (Condition A or Condition B)

    if Condition A is true and Condition B isn't

    And if Condition B is a Sprite condition (like Sprite: [Invert] is visible)

    Expression like Sprite.X and Sprite.Y returns 0.

    I would expect to get the position of the first instance of the Sprite but it seems, since the condition involving the sprite is false, that c2 can't pick it so it returns nothing as if no sprite were in the layout.

    But the thing that is even more weird is that if I use a trigger as Condition A like 'On Start of Layout', the Sprite is properly picked

    Anyway, a capx should make more sense

    or&picking.capx

  • nClosest.capx

  • Alright, I hadn't tried this example, makes more sens when you interact with the little HTML5 logo.

    for 1 and 2 I'd say you can always play around with VelocityX and VelocityY

    They are vector component you can get and set as you want.

    for 3 you can dynamically switch the blocked door to immoveable depending on the context (eg: there's a fridge in front).

    for 4 apply impulse at angle angle(monster.X,monster.Y,sofa.X,sofa.Y)

  • Heptagono

    Add an instance variable in the slid_line object and assign different value to each of your object.

    This way you can pick the one you want.

    for instance let say you create the instance variable 'name' for your slid_line.

    +slid_line: name = "option2"
      -> System: set option2 to slid_line.value
  • top-down?... why physics?

  • stemkoski

    nifty indeed (:

  • Line of Sight...

    LoS.capx

  • Alright thanks (: I think you can safely close this one

  • ranma

    hmmm yeah probably but it makes the expression far less cute ;_;

    lvl.At(loopindex("x")+round(cos(a)),loopindex("y")+round(sin(a)))

    instead of

    lvl.At(loopindex("x")+cos(a),loopindex("y")+sin(a))

    yeah ok... you're right :D

  • ranma

    Yeah you're probably right on one thing, I probably doesn't get exaclty 0 in the expression.

    In theory cos(270) should return 0 (because it's the downward 90 degree angle so it projects on 0 in the abscisses)

    But I know for instance that in C++ you don't get perfect number. I guess in js it must be the same, but as the display in the text object is ok, I think there's already some kind of rounding somewhere along the line.

    Except in Array.At() expression (and maybe in others)

    That's why I think it's a bug or at least an unexpected behavior. (doesn't happen for cos(90) for instance)

  • ranma

    google works with radian angles, construct 2 with degrees

    270? = 3*pi/2 radians

    and google says cos(3*pi/2) = 0

  • Here I gave it a try and optimized code and perfs

    terrainGenerator.capx

    Didn't know this midpoint algo

  • When I use a cos(270) or cos(-270) in an Array.At expression

    I don't get the expected result unless I round them.

    Anyway, a capx is better than a thousand words

    cos&Array.capx

    I discovered this weird bug by playing with a terrain generator (from Intrepid) to get the 4 surrounding cell of the terrain array through a loop instead of 4 events (was too lazy)

    Yann2012-05-24 01:59:57