Hello, i’m now working on Monster and Player behavior/attributes script, but i confused a bit…
so i creating a battle game, which is going through stages… in stage 1 we face this monster, and stage 2 we face another monster, etc…
so is that better to create 1 script for every monster?
i mean my monster is all different, should i attach 1 script, (containing atk, hp, etc.) to every monster, or i should do global scripting, i mean all attributes for all monster, and change it manually, maybe on Inspector or else.
In my opinion it should depends on the variety of your monsters. It is ok when you have one script for all monsters when the difference between them is only health value, weapon power or mesh. But if your decide to implement different logic and behaviour for monsters you should create some different logic or behavior scripts, imho.
Conclusion: to make one scrips for all monters when difference in data, and to make some scripts when difference in logic.
Am not 100% sure of what you are asking, do you mean creating unique script for per monster?
or you mean you are confused between attaching script to each monster gameobject and having a single global script that controls all these monsters?
generally if you write so many classes it will be a complex mess that is hard to maintain and ruins your fun in programming…
so it’s better to plan/design your game and decide early on what are the monsters attributes/Skills/etc then find similarities…
sometimes a lot of unique stuff you thought of for a monster can be very common thing to other monsters with little tweaking in logic.
thanks @mangax and @Patico, yeah i confused either should i create 1 script which is (hp,atk,def,other_stats) on 1 monster or just make 1 script for all the monster…
since my game is simple, and only battle, there’s no unique behavior i think…
its just the monsters are all different shape, and different animation for each of their skill…
ok, i think i go with making 1 script for them all and initiate the value on inspector… thanks thou for some good advice out there