$12256 / $11500
Hello
I am trying to get into game development and was looking at the FLARE source code. I think that an attack (by the player or a monster) is a "hazard", but i do not understand how the attack is started.
Another question:
Do you recommend using FLARE and the FLARE source code to learn about game development or is it better to start an own projekt? (I know how to code)
Anon,
Some notes about how attacks work. The Avatar and Enemy classes have a logic() routine. Enemy actually uses the BehaviorStandard::logic() routine; that one's cleaned up so maybe it's a good place to look.
When the player presses an attack button, or the enemy decides to attack, they switch to an attack state (which has an appropriate animation, like swing/shoot/cast). At a certain Active frame in the animation it calls PowerManager::activate(). If it is the kind of power that causes a Hazard, that's where it is created. Each frame, active hazards are compared to the list of enemies to check for hits. If you need a more detailed explanation of any part of that just let me know.
I'm not sure if Flare is a good place to learn. I want to think so -- many people from many different countries have worked on Flare, so it must be relatively easy to learn. It is definitely a very simple approach to a game engine. Most modern engines are far more complex, usually for good reasons though.