The game I'm currently working on is a multiplayer top down survival game. Most of the controls will be done using the mouse. When you click on the ground the player moves, when you click on an enemy the player can attack, click on a resource and the player will gather. There are also items you can pick up, put down, as well as buildings you can place.
I have the majority of this working although I started running into issues and it started looking weird to me. I pretty much had everything coming off the tick function, checking if the player is currently trying to move, if not if he's trying to attack, if not and so on. I have 2 ideas and I was wondering which one would work better, or if anyone has a better idea
My first thought was to use a sequence that goes through all the possible options a player could be doing, but using flags to just jump out of we don't need it.
My second thought was to use enums and a switch to change based on what the player is currently trying to do. I would just have to figure out what he's trying to do first and then switch to which action to call.
If anyone has any better ideas please let me know, or if you need more info I can provide that as well. Thanks!
I have the majority of this working although I started running into issues and it started looking weird to me. I pretty much had everything coming off the tick function, checking if the player is currently trying to move, if not if he's trying to attack, if not and so on. I have 2 ideas and I was wondering which one would work better, or if anyone has a better idea

My first thought was to use a sequence that goes through all the possible options a player could be doing, but using flags to just jump out of we don't need it.
My second thought was to use enums and a switch to change based on what the player is currently trying to do. I would just have to figure out what he's trying to do first and then switch to which action to call.
If anyone has any better ideas please let me know, or if you need more info I can provide that as well. Thanks!
Comment