How did slave codes affected enslaved people?
They were legislations that defined the status of slaves and how the institution of slavery should work in every state.
The Black codes existed in every state and defined the precise laws that have to be abided by regarding the institution of slavery.
The black codes were passed during the time immediately after the Civil War 1865 and 1866, The black codes were passed in the southern states as a means of maintaining the power of the former slave owners. These laws restricted the freedom of the former slaves. In effect the black codes reestablished a form of slavery in the south.
More details:What were the black codes?