Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Made a Function to scroll multiple sections of a background.
#4
Hi,
Usual way is to define the size, and then use the size to build the arrays and pass it as a parameter:


Code:
#define NUM_SECTIONS 6
float bg_offsets[NUM_SECTIONS];
float bg_speeds[NUM_SECTIONS];

/* call your function */
TLN_SetBackgroudScrolls(bg_offsets, bg_speeds, NUM_SECTIONS, 1.0f);

/* function definition specifying size as a parameter */
void TLN_SetBackgroudScrolls(float bg[], float  bgspeed[], int num_sections, float factor)
{
   ...
}

Cheers!
Reply


Messages In This Thread
RE: Made a Function to scroll multiple sections of a background. - by megamarc - 09-20-2020, 04:30 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)