Yann's Forum Posts

  • pin is just a behavior that does the same thing as

    system : every tick
        -> secondText: set position to firstText

    and nobody said you can't use pin

  • Try with different density maybe.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I tested you can easily rotate a layer or the entire layout, but what you want is a mirroring, so a negative scale on the Y axis.

    And as far as I tested, negative layerscale doesn't work as expected (it makes your layer disappear) and you can't select a specific axis for this anyway.

  • well

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

    is exactly the same as

    enemy: X > player.x-distance
    enemy: X < player.x+distance
        -> do things

    And I think the picking would work

    But if you really insist on using the system comparison, just put a foreach on top

    foreach enemy
    System: abs(player.x-enemy.x) < distance
        -> do things
  • enemy: X <= Player.X
    enemy: X > Player.X-distance
      -> enemy: set not mirrored
    enemy: X > Player.X
    enemy: X < Player.X+distance
      -> enemy : set mirrored

    Like that? o.o

  • Yeah anim I saw rojo post a capx on emulating a "pick top most" behavior but I was too lazy to implement it :D... my capx is an old one I made like a month and half ago.

  • If you want your ennemies to always look at the player (that's how I understand your AI) you just have to do :

    enemy: X <= Player.X
      -> enemy: set not mirrored
    enemy: X > Player.X
      -> enemy : set mirrored
  • Howdy

    Little bug If you try positionning the button object in fullscreen scale mode. It gets offsetted quite a bit. As if they were in a different coordinate space than the other objects.

    buttonPositionningFullscreenScaled.capx

    Yann2011-12-17 18:09:45

  • there ya go

    centering.capx

    Basically you had a useless behavior on the title text (anchor)

    And you have to scroll to the center of the layout for your object to be centered.

    And do that every tick in case people resize the window.

  • drag&drop for ya

    drag%26drop.capx

  • The result is not the same.

    If you check the distance you basically discard the size of the sprite.

    If you use a sprite for collision/overlapp detect you don't care where the hotspot is.

    I guess the first one is better for small elements and the second one should be use for bigger ones.

  • It's weird fmaf.

    You have a boolean to tell if you are attacking or not

    and a string to name a state.

    And also it seems you can have state = "Idle" while Attack is true.

    That is a bit incoherent (even if it may work with what kbo said)

    So, what I would do is :

    System: Start of layout
        -> Player: set idling to true
    Keyboard: on Espace pressed
    Player: [invert] is moving
    Player: is on the floor
        -> Player: set attacking to true
        -> Player: set idling to false
    Player: is idling
    System: trigger once
        -> Player: set animation to "Idle" (play from begining)
    Player: is attacking
    System: trigger once
        -> Player: set animation to "Attack" (play from begining)
    Player: On animation "Attack" finished
        -> Player: set attacking to false
        -> Player: set idling to true
    

    (I like using -ing form for boolean... you can really read the capx like a book :D)

  • First, does your php script works?

    Do you get the header and content from scoreoid.com/api/getNotification as expected?

    If yes, I think you just have to do a

    System: start of layout
        -> AJAX: Request"http://yourdomain/blahblah/yourphpscript.php" (tag:"call")
    AJAX: On "call" completed
        -> Text: set text to AJAX.LastData
    AJAX: On "call" error
        -> Text: set text to "An error happened."

    Also you might want to replace

    if ($result['status'] == 'ok')
    {
        echo $result['header']; 
        echo '<hr />';
        echo $result['content'];
    }

    by

    if ($result['status'] == 'ok')
    {
        echo $result['header']."\n".$result['content'];
    }

    As Construct2 won't parse the HR element.