Skip to main content
Fix mispelling
Source Link
Dan Oberlam
  • 8k
  • 2
  • 33
  • 74

That looks really good! I just have a few improvements, nothing big.

Wind.interplorateWindSpeed()

A math function called signum could be used instead of ifsif statements.

    float speedDiff = targetSpeed - speed;
    
    float speedChange = (float) (sqrt(abs(speedDiff))/15);

    speed += speedChange * signum(speedDiff);

Wind

You might consider moving all the private floatsfloats values into a constructor, just for consistency.

Thoughts

Really these are just small tweaks, you have some very well-written and documented code!

The next thing to do would be to make more types of snowflakes (hexagons, stars, textures) for variety.

That looks really good! I just have a few improvements, nothing big.

Wind.interplorateWindSpeed()

A math function called signum could be used instead of ifs.

    float speedDiff = targetSpeed - speed;
    
    float speedChange = (float) (sqrt(abs(speedDiff))/15);

    speed += speedChange * signum(speedDiff);

Wind

You might consider moving all the private floats values into a constructor, just for consistency.

Thoughts

Really these are just small tweaks, you have some very well-written and documented code!

The next thing to do would be to make more types of snowflakes (hexagons, stars, textures) for variety.

That looks really good! I just have a few improvements, nothing big.

Wind.interplorateWindSpeed()

A math function called signum could be used instead of if statements.

float speedDiff = targetSpeed - speed;
    
float speedChange = (float) (sqrt(abs(speedDiff))/15);

speed += speedChange * signum(speedDiff);

Wind

You might consider moving all the private floats values into a constructor, just for consistency.

Thoughts

Really these are just small tweaks, you have some very well-written and documented code!

The next thing to do would be to make more types of snowflakes (hexagons, stars, textures) for variety.

That looks really good! I just have a few improvements, notingnothing big.

Wind.interplorateWindSpeed()

A math function called signum could be used instead of ifs.

    float speedDiff = targetSpeed - speed;
    
    float speedChange = (float) (sqrt(abs(speedDiff))/15);

    speed += speedChange * signum(speedDiff);

Wind

You might consider moving all the private floats values into a constructor, just for consistency.

Thoughts

Really these are just small tweaks, you have some very well-written and documented code!

The next thing to do would be to make more types of snowflakes (hexagons, stars, textures) for variety.

That looks really good! I just have a few improvements, noting big.

Wind.interplorateWindSpeed()

A math function called signum could be used instead of ifs.

    float speedDiff = targetSpeed - speed;
    
    float speedChange = (float) (sqrt(abs(speedDiff))/15);

    speed += speedChange * signum(speedDiff);

Wind

You might consider moving all the private floats values into a constructor, just for consistency.

Thoughts

Really these are just small tweaks, you have some very well-written and documented code!

The next thing to do would be to make more types of snowflakes (hexagons, stars, textures) for variety.

That looks really good! I just have a few improvements, nothing big.

Wind.interplorateWindSpeed()

A math function called signum could be used instead of ifs.

    float speedDiff = targetSpeed - speed;
    
    float speedChange = (float) (sqrt(abs(speedDiff))/15);

    speed += speedChange * signum(speedDiff);

Wind

You might consider moving all the private floats values into a constructor, just for consistency.

Thoughts

Really these are just small tweaks, you have some very well-written and documented code!

The next thing to do would be to make more types of snowflakes (hexagons, stars, textures) for variety.

deleted 92 characters in body
Source Link
Blue
  • 574
  • 2
  • 11

That looks really good! I just have a few improvements, noting big.

Wind.interplorateWindSpeed()

A couple things to make it shorter:math function called signum could be used instead of ifs.

  1. You don't need sqrt(abs()), sqrt takes care of that

  2. A math function called signum could be used instead of ifs.

    float speedDiff = targetSpeed - speed;
    
    float speedChange = (float) (sqrt(speedDiff)/15);
    
    speed += speedChange * signum(speedDiff);
    
    float speedDiff = targetSpeed - speed;
    
    float speedChange = (float) (sqrt(abs(speedDiff))/15);

    speed += speedChange * signum(speedDiff);

Wind

You might consider moving all the private floats values into a constructor, just for consistency.

Thoughts

Really these are just small tweaks, you have some very well-written and documented code!

The next thing to do would be to make more types of snowflakes (hexagons, stars, textures) for variety.

That looks really good! I just have a few improvements, noting big.

Wind.interplorateWindSpeed()

A couple things to make it shorter:

  1. You don't need sqrt(abs()), sqrt takes care of that

  2. A math function called signum could be used instead of ifs.

    float speedDiff = targetSpeed - speed;
    
    float speedChange = (float) (sqrt(speedDiff)/15);
    
    speed += speedChange * signum(speedDiff);
    

Wind

You might consider moving all the private floats values into a constructor, just for consistency.

Thoughts

Really these are just small tweaks, you have some very well-written and documented code!

The next thing to do would be to make more types of snowflakes (hexagons, stars, textures) for variety.

That looks really good! I just have a few improvements, noting big.

Wind.interplorateWindSpeed()

A math function called signum could be used instead of ifs.

    float speedDiff = targetSpeed - speed;
    
    float speedChange = (float) (sqrt(abs(speedDiff))/15);

    speed += speedChange * signum(speedDiff);

Wind

You might consider moving all the private floats values into a constructor, just for consistency.

Thoughts

Really these are just small tweaks, you have some very well-written and documented code!

The next thing to do would be to make more types of snowflakes (hexagons, stars, textures) for variety.

Source Link
Blue
  • 574
  • 2
  • 11
Loading