David Flook's Forum Posts

  • Instance variables are used when you want a piece of data to be unique to an instance. In other words, if you have 10 sensors with an instance variable called "range" (for example), each sensor can have a different value for "range".

    When a player object collides with a sensor, C2 will pick the specific instance(s) of sensor that collided with player. If you then access the sensor's instance variable, it will be specific to that sensor.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Without using unofficial plugins, you can use the Timer object to lerp (linear interpolation) between 2 values smoothly.

    For example;

    Set timer to 1 second

    every tick;

    lerp(x1, x2, timer.CurrentTime / timer.Duration)

    lerp(y1, y2, timer.CurrentTime / timer.Duration)

    and because the timer resets to zero, you need to add;

    OnTimer | set position to x2, y2

  • Simple. All you need to do is create two instance variables for your sprite. Let's say Old_X and Old_Y

    Now every tick you first compare;

    is Old_X < X? then set Not Mirrored

    is Old_X > X? then set Mirrored

    (this might be reversed depending on which way the sprite is defaulted)

    then set;

    Old_X = Sprite.X

    Old_Y = Sprite.Y

  • As for the hand selector. You should set the initial position to;

    enemy.x and enemy.y - 100

    instead of enemies.x and enemies.y - 100 (this is the entire family)

  • Just a quick look through your code I can see one problem.

    You subtract 3 from the HP then immediately adjust the HP Bar accordingly.

    However, you need to clamp the HP before adjusting the bar.

  • webGL in both cases.

  • While playing around with optimization using a simple test bed with 600 sprites bouncing around the screen;

    [viewing in Chrome on the desktop]

    I noticed that with no effects, I'm getting about 44 fps.

    Now after adding an effect like "Brightness" to the entire layer, I get a fairly solid 60 fps. Now Brightness is set to default 100 meaning it isn't changing anything visually.

    Any idea what's happening here?

  • Wow, incredible. Thanks.

  • If an image in your project is already a PNG8, does the exporter further process the image or ignore it?

    Thanks.

  • Interesting.

    I think it's because "Pick by Evaluate" picks individual instances and doesn't include any instances even in a container that evaluate to zero.

    Try using Mouse: Cursor is over "Sprite" to see the difference.

  • To use a container, click an object to view it's properties. You will see Container below Effects.

    Now click Create.

    A window will pop up asking you to add other objects to the Container. You can add/remove objects at any time.

    When ever you create any object in a Container, Construct will create all the other objects in the Container automatically.

    When any object in a Container is "picked", all other objects in the Container are also picked.

  • Strangely, that's a product of WebGL. Try turning it off for a moment to see the difference.

  • The "Text" plugin is included with Construct 2.

  • "he automatically rotates towards the center of the screen" I think something else must be causing this because 8-direction doesn't automatically rotate the object.

  • Tiles won't help you in this case because you only get a performance boost from tiles if you're using them to repeat more than once.