J
Jacob Thrasher
Guest
In a platformer I am working on I would like to have various types of enemies, each with different abilities. I am unsure of what is the best way to go about including them so that the code runs as quickly and as smoothly as possible.
I have two things in mind:
-Creating a unique enemy object for each type of enemy and having the bullet object test for collisions with each type of enemy object. This would require a lot of collision checks, which I know slow the program.
OR
-Create one enemy object in which I can easily change the sprite indexes within in creation code. Then within the object, I would use various if statements to determine which type of enemy it is supposed to be and it would only access the necessary code for that instance. This would then require only one collision check from the bullet object, but I would also have to have a bunch of logical tests which could also slow the game down.
It is really a matter of what will be the most efficient way for GameMaker to interpret the code. This is my first game so I am pretty inexperienced. I would like to avoid as many bad practices as I can while I learn.
Thank you!
I have two things in mind:
-Creating a unique enemy object for each type of enemy and having the bullet object test for collisions with each type of enemy object. This would require a lot of collision checks, which I know slow the program.
OR
-Create one enemy object in which I can easily change the sprite indexes within in creation code. Then within the object, I would use various if statements to determine which type of enemy it is supposed to be and it would only access the necessary code for that instance. This would then require only one collision check from the bullet object, but I would also have to have a bunch of logical tests which could also slow the game down.
It is really a matter of what will be the most efficient way for GameMaker to interpret the code. This is my first game so I am pretty inexperienced. I would like to avoid as many bad practices as I can while I learn.
Thank you!