shooter game example question(about API using)

That is a define that is important for the DLL that is created for your module. This is “should do” behavior if your code is going to be a DLL. The name of the macro is implementors choice for sure. In Unreals case it is always MODULENAME_API.

Defines do not need to exist at code time and can get defined at compile time.