Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Stuck with something in scene_battle 4

I'm trying to make weapons that can attack all the enemies:
Code:
 # Set array of targeted battlers

       #All weapon?

       if @active_battler.is_a?(Game_Actor) and @active_battler.todos_w? #Return true if the actor have a special weapon

        for enemy in $game_troop.enemies

          if enemy.exist?

            @target_battlers.push(enemy)

          end

        end

      end 

 

          [b]@target_battlers = [target] [/b]

 

      # Apply normal attack results   

      for target in @target_battlers

        target.attack_effect(@active_battler, target, $x_contr)

      end

 

 
I don't understand how the bold line works, a direct asignement of an object to an array??? without an index?

Now it just don't work. It only attacks one time, and if i delete the bold line the bucle dont make anything at all.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top