hit and destroy enemy like mario style

Happy to hear that is solved. I know that you are learning things and its totally find to do things in traditional pattern, however would like to carry you one more step further without confusing you with additional design patterns or approaches.

Try to encapsulate logic gates between gameplay contexts.

A function to make mario big or small
A function to check if target is under foot
A function to check if target on side.

So you can always call same functions and your coding becomes more readable and extendable.

Another thing for you I think can be usefull is Enum Variable Type. You can create a blueprint enum from

You can create states like this for mario

and you can ask marios state to do various things like below

so you have more organised way of detecting states and what needs to happen.

There is further mechanics that can be crafted and player state, state trees or gameplay ability system, however enums would be a good match for you to learn basics.

Iyi calismalar :slight_smile:

1 Like