#who got a game idea
1 messages · Page 1 of 1 (latest)
https://devforum.roblox.com/t/looking-for-a-very-simple-but-engaging-game-idea/4231172/3?u=cyrusdevs
I like this post
Make a btd 6 rip off 👍 Good for learning O.O.P. i think
or just make systems that you think would be cool that you can also use in other projects like an emote system or an building system
I mean any project can be good for learning OOP
🥀
nah
how so?
name one project OOP could not be applied to
?
that’s not what i said or the subject is.
i said not all projects are useful to use to learn oop
if you try to forcefully apply oop to a game or concept where that’s a terrible idea you’ll end up with bad habits instead of new knowledge
whether the game is a terrible idea or applying oop is a terrible idea?
because I'm implying applying OOP can never be a terrible idea
it definitely can if you force it in places where it shouldn’t be
where should OOP be?
in places where it’s needed lol
I think you have a lack of understanding of OOP
if you use it improperly you’ll make your code less optimized more verbose and just worse
I can kind of agree on the verbose part
like I dont think there should be a subclass for everything like some people do, but its also better for things like data ownership
so, you checked yet?
** You are now Level 11! **
then don’t blindly assume people lack experience because they’re stating an opinion that contradicts yours
I wouldnt really call your github really showing experience
you have 4 projects, one of which is lua
which is a state machine
hold on let me read it
plenty of OOP use to prove I’m not incapable of using OOP properly 👍
I wouldnt really call this plenty of OOP use
but
I'm just trying to say that OOP is more useful than just things like, creating entities n shit
I personally make all my modules classes
Give an example of this
You gotta be ragebaiting
nope let me show you
Here is the code for my (very early) fight system
its a singleton class, if I need my fight system functions or data from another script, I instance my fightsystem again and since its a singleton it returns the previously existing instance
granted... granted
if you look at the top
there is this line of code
system.local module = require(game:GetService("ReplicatedStorage").CoreModules.ClassSystem).new({
class_name = "FightSystem",
is_singleton = true
})
and that is a little.. verbose but
it allows me to make classes in lua easier since there is not support for it by default (like in c++)
dawg…
there is nothing wrong with that I'm actually quite proud of my class system
i only had to write it once and its transferrable to use in all of my code
now all my classes support: inheritance, constructor chaining, and singletons without all the boilerplate that comes with psuedo classes in lua
so the boilerplate of using classes in everything and cluttering your code with overly verbose classes are a better solution? 🤔
you're mistaken, there is no boilerplate for setting up classes for my code. I actually built it to specifically be just like a regular module
alr well we aren’t gonna make any progress here, so if you’re happy w it then good for u!
local module = require(game:GetService("ReplicatedStorage").CoreModules.ClassSystem).new({
class_name = "ClassName",
})
function module.new()
local self = {}
self.TestValue = "hello!"
return self
end
function module:TestFunction()
return self.TestValue
end
return module
this is what like a baseline version would look like
no setmetatable here!
i do not like having to copy and paste the thing to require the module though
that is the only thing I would call boilerplate
technically regular modules have more boilerplate since there is no
module.__index = module
or
return setmetatable(self, module)
Point is I make my code less verbose with OOP
oh did I mention it also supports virtualized functions?
I can nerd out quite a bit on this topic but I dont think you really care to hear
is it not? im trying to learn O.O.P. that way
It is, its better to separate each of your towers logic into their own classes.
you can define like a base tower & the data on it like health, damage, model, and then create sub classes based on that base tower for each tower and its specific functions. This is helpful because what if every tower has some sort of base functionality that needs to be replicated across all the towers, you're gonna have to copy paste code or and make ur game a big spaghetti mess of arbitrarily placed functions
and the typical usecase of OOP is to represent many similar but different objects (towers)