David Flook's Recent Forum Activity

  • I noticed a massive performance drop. From 30 fps down to 5 for a project I'm working on.

  • But to be clear, it's not the same movement right?

    Lerping self to target will create movement that starts fast and slows as it approaches the target. Is that correct?

  • To be honest, I don't even know if animated GIFS even work in C2? But it doesn't really matter because animating in C2 is far better.

    Don't bother creating sprite sheets, C2 creates these on export for you anyway. Simply select all the frames you want in an animation and drag them into C2. This is a shortcut for importing but you can always add/remove frames at any time.

    Animating in C2 gives you the ability to control the animation and individual frame speeds as well.

    The animation system in C2 is amazingly flexible. Often I don't use it for animation at all :)

  • 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.

  • 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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If an image in your project is already a PNG8, does the exporter further process the image or ignore it?

    Thanks.

David Flook's avatar

David Flook

Member since 9 Nov, 2012

None one is following David Flook yet!

Trophy Case

  • 12-Year Club
  • Coach One of your tutorials has over 1,000 readers
  • Email Verified

Progress

14/44
How to earn trophies