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.

Need feedback on this.

Ok as everyone knows I am creating a platform script but I reached to a point where I need to create The battle system.I though of a way of making it pretty custumizable but I reached to a point where I could only do that by creating the enemies by Scripting them, but That would make my script be used by only those who new how to script.. So I decided to create a module with funtions for enemies, like enemie_touch, hurt, etc.This way every enemy will have it's own AI. The enemies will be simple to do(just need some praticse). Here is a example on how this would work:

Code:
  #Default Enemy
  class Bee
    #-----------------------------------------------------------------------------
    # * Object Initialization
    #-----------------------------------------------------------------------------
    def initialize(id)
      @me = $game_map.event[id]
      @team = 1
      #List of skills that the enemie can Use
      @skill_list = AI::Skill_List[1]
      #Agressiviness
      @agre  = 30
      #Enemy Sight
      @sight = 5
      #Hear Range
      @hear  = 10
    end
    #-----------------------------------------------------------------------------
    # *Frame Update
    #-----------------------------------------------------------------------------
    def update
      #Check if the player is touching the event
      if AI.player_touch(@me)
        #do_Action
      end
      #Check if the player is in  Sight range
      if AI.player_in_sight?(@me,@sight)
        #do_Action
      end
      #check if the player is in hear range
      if AI.player_in_range?(@me,@hear)
        #do_Action
      end
      #check if the player Attacked one team member
      if Ai.team_attacked?(@team)
        #do Action
      end
    end

the #do action thingy, iks going to be commands predefined in the AI module.
There is still alot to do, but tell me what you think of this Idea?
 

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