Skip to main content

User login

What is OpenID?
  • Log in using OpenID
  • Cancel OpenID login
  • Create new account
  • Request new password
Register
  • Home
  • Browse
    • 2D Art
    • 3D Art
    • Concept Art
    • Textures
    • Music
    • Sound Effects
    • Documents
    • Featured Tutorials
  • Submit Art
  • Collect
    • My Collections
    • Art Collections
  • Forums
  • FAQ
  • Leaderboards
    • All Time
      • Total Points
      • Comments
      • Favorites (All)
      • Favorites (2D)
      • Favorites (3D)
      • Favorites (Concept Art)
      • Favorites (Music)
      • Favorites (Sound)
      • Favorites (Textures)
    • Weekly
      • Total Points
      • Comments
      • Favorites (All)
      • Favorites (2D)
      • Favorites (3D)
      • Favorites (Concept Art)
      • Favorites (Music)
      • Favorites (Sound)
      • Favorites (Textures)
  • ❤ Donate
FLARE [ARCHIVED]

how does FLARE manage an attack

Anonymous
Saturday, June 23, 2012 - 01:49

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)

  • Log in or register to post comments
Clint Bellanger
joined 15 years 10 months ago
Saturday, June 23, 2012 - 18:42
Clint Bellanger's picture

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.

  • Log in or register to post comments