There are a lot of people here who enjoy helping out with code. So you came to the right place.
Videos of other people's work do very little to help us understand what help you need with code.
Usually, you post your code that represents your best effort at meeting your goals.
Describe what you expect your code to do.
Then describe what actually happens and how that differs from your expectations.
All of the videos you linked to had working robots. All of the hardware was there, ready to walk. Then the designers added the 'learning' elements to the algorithm.
Do you have a working robot?