Don't try to memorize blocks of code as much as try to understand the syntax of a language, which it seems like you may be close to if you can read code but struggle to write it. Learn about all the type of operators and function designations in your chosen language and memorize that information.
From there, do a bit of study on data structures/types in your chosen language. This will help you understand how information is conveyed and referenced within code blocks.
After that, it's up to you. It's quite similar to writing in typical human language, much like this response I am giving. Once you know the nouns (data types) and verbs (function syntax) you just string them together to achieve what you want to convey.
Obviously this is a bit simplified but it will get you past the "writers block" you are experiencing so that you can further study optimization and such, refine your code much like a scholar would refine their written word.
Occasionally get a text from your mate that moved to the US, reminding you that it's not actually that hot compared to the US.
Active ragdolls are awesome. That is all.
Someone tried to tell me the other day that menial task games weren't the new "thing"...
Don't stop, do not get distracted by shiny new ideas, carry a project to the end.
I've got hundreds of projects that will never see completion because my ADD said try something else.
If you can send one through to finished game, regardless of quality, you will have achieved more than 95% of people who set down this path.
Don't try to memorize blocks of code as much as try to understand the syntax of a language, which it seems like you may be close to if you can read code but struggle to write it. Learn about all the type of operators and function designations in your chosen language and memorize that information.
From there, do a bit of study on data structures/types in your chosen language. This will help you understand how information is conveyed and referenced within code blocks.
After that, it's up to you. It's quite similar to writing in typical human language, much like this response I am giving. Once you know the nouns (data types) and verbs (function syntax) you just string them together to achieve what you want to convey.
Obviously this is a bit simplified but it will get you past the "writers block" you are experiencing so that you can further study optimization and such, refine your code much like a scholar would refine their written word.