Yann's Recent Forum Activity

  • Be carefull, it's

    (ViewportLeft("Layer") + ViewportRight("Layer")) / 2[/code:2k2l7if5]
    With the parenthesis. You need to sum the values first and then divide by 2 (it's the average between the two positions)
    
    I usually use something slightly more flexible:[code:2k2l7if5]Object: set position to  (ViewportLeft(Self.LayerNumber) + ViewportRight(Self.LayerNumber)) / 2[/code:2k2l7if5]
    
    Also if you want something 10 pixels from the left of the screen, you just have to do [code:2k2l7if5]ViewportLeft(Self.LayerNumber) + 10[/code:2k2l7if5]
    But if your layer is scaled, 10 pixels might appear greater or smaller than expected.
    
    The way to counter layerscalling might be to do
    [code:2k2l7if5]ViewportLeft(Self.LayerNumber) + 10/LayerScale(Self.LayerNumber)[/code:2k2l7if5]
    
    Also, to be really complete, if your layer's scale rate isn't 100% you might need to do
    [code:2k2l7if5]ViewportLeft(Self.LayerNumber) + 10/(LayerScale(Self.LayerNumber) * LayerScaleRate(Self.LayerNumber))[/code:2k2l7if5]
  • RamPackWobble you do have a point here, I noticed going through c2's javascript that dt was clamped to 0.1

    It's a common technique to avoid object teleportation. But yeah in sinneruy's specific case it might be detrimental.

    I modified the capx to compute my own dt using wallclocktime. It should counter this issue.

    hiddenObjectClock.capx

  • C2 automatically gather all animations on one big texture on export, so under the hood it exactly does what you are suggesting.

  • That's how I would implement your system

    hiddenObjectClock.capx

    dt and time have the same accuracy, as time is internally computed by adding dt to it each frame.

  • Not possible. And you don't really need other layouts anyway.

    A layout is an abstract concept that is mainly important when you edit your game (when you make the level manually for instance)

    The only thing that matters in your case is displaying something on the screen. Whether it's in one layout or another is irrelevant.

    If you want an infinite universe, you just have to know what you have to display according to your data representation.

    And if you want to have on part of your came representing the entire space and another part where you actually land on a planet... I would just have a Space layout and a Planet layout. When you enter a planet you just have to go to the Planet layout and generate the corresponding planet.

    If you worry about persistency (going back to the same planet should generate the same random one), you have to use some nifty seed hierarchy. But I trust you know about that =)

  • Well, why not directly using the Tint effect then? or even Tint with Adjust HSL if you want more control?

    Demo

    capx

  • dt (deltatime) is the time (in second in c2) elapsed between the previous frame and the current.

    So if you accumulate them you'll reach 1 in one second.

    If you run at 60 fps (frame per second), the time between two frame is about 0.016s (1/60)

    So after 60 frames, 1 second will have elapsed and you would have acumulated 60 * dt = 60 * 1/60 = 1.

  • ^\S+\s means a line which starts with one or many non white-space character followed by one white-space character (but I think you got that one)

    g (global) means you want to replace all the occurence of your regex. Without it would only match the first one.

    However in your case, since you're not using the m flag (multi-line), even if your text contains line break, ^ will only consider the begining of the entire string (whith m it considers each line one by one).

    So the g flag is useless since you'll only ever have one occurrence matching.

    more info over there

  • newt using an instance variable would be redundant in this case.

  • newt you do need to pick via UID if you want to know what is the particular object type of the family member you picked (yes it's usefull sometimes)

    However, I agree with you on the fact that if he wants to decrease the hp of any object in the family, the hp should be a family variable, not an instance variable.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Is the game played through the mobile web browser, or in a native wrapper like phonegap?

    A black screen could be caused by the wrapper failing, or maybe by a memory failure (too big assets?)

    What could be done to rule out a logic bug would be to just make a simple C2 app (like something that displays a countdown), If it displays correctly, it means your logic is the problem. Else, it means it's either C2 or your eventual wrapper, or memory.

    You could also test with a simple capx with no event (so no logic bug) but with a lot of images. To check if it could be a memory issue.

    In any case, not having access to a console will limit your research.

  • It's hard to understand the reason of the comportment you describe.

    Thus, I'm not really sure I understand.

    But I read this as:

    if shooter has in range enemy1 and 2 enemy 2, it should first target enemy 1 if enemy 2 isn't on the back of the shooter (?), else, the closest enemy2... Still feel kind of weird.

Yann's avatar

Yann

Member since 31 Dec, 2010

Twitter
Yann has 5 followers

Connect with Yann