Thread: NPC Battles?
View Single Post
  #3  
Old 03-20-2016, 02:40 PM
FounderSim FounderSim is offline
Member
 
Join Date: Sep 2014
Posts: 65
Gender: Male
Credits: 7,818
FounderSim is on a distinguished road
Default

Instead of using this:
if($mysidia->input->post("spell"))

elseif($mysidia->input->post("tackle"))

else if($mysidia->input->post("trick"))


Switch statements may be better. I would also suggest keeping a lot of the "attack logic in separate files". Battle systems are fairly complex to keep organized, debug and expand upon if you have not been coding for awhile or new to coding battle systems.
__________________
Reply With Quote