2D Game Enemy AI Help


So i want to make an ai like this, i was planning to use just a ai controller i managed to do the roam part but it seems hard to do the attack part by that. I dont know anything about the blackboards or Behavior tree can someone help me pls.