Another way of doing the challenge using AnimData struct

I’ve declared the AnimData neb2Data to use variables from nebData. No need to calculate those again and rewriting the code.

AnimData neb2Data{
      nebData.rec,
      {nebData.pos.x + 300, nebData.pos.y},
      nebData.frame,
      1.0f / 16.0f,
      nebData.runningTime};

Putting the nebData for the reference here:

AnimData nebData{
      {0.0f, 0.0f, (nebula.width / 8.0f), (nebula.height / 8.0f)}, // Rectangle
      {window_width, window_height - nebData.rec.height},          // Vector2 Pos
      0,                                                           // int frame
      1.0f / 12.0f,                                                // float updateTime
      0.0f                                                         // float runningTime
  };

Privacy & Terms