In what specific situation can i use OOP

Soo, apart of core game mechanics on server, i don’t see any other use for OOP over FP or normal programming, i want some suggestions on what specific type of stuff (e.g tools, some specific mechanics or maybe with some objects) where i can use it.

Note: I know what is OOP and how to use it, i simply don’t know where to use it

On a personal level, I’ve used OOP with tools, such as weapons. In other cases, I’ve used OOP in a dining game where each food had it’s own class and would implement the “Eat” function differently depending on the food.

Currently, I’m using OOP for my NPC system, each NPC model having it’s own class where I could control it using NPC:LookAt(position) and NPC:WalkTo(position). Of course I could also use FP for this but sometimes I prefer OOP.

2 Likes

soo you use OOP only for stuff that needs some functionality that will be repeated, and FP for rest right?

You can use OOP for anything, just like how you could use functional programming for anything. It’s nothing but which you think would be easier to implement for that specific task.

4 Likes

Yhmm, soo choose the one which is easier for me to implement, thx

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.