#who got a game idea

1 messages · Page 1 of 1 (latest)

tropic seal
#

im bored

tranquil meteor
#

I like this post

white prawn
#

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

trim junco
smoky lintel
trim junco
trim junco
smoky lintel
#

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

trim junco
#

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

smoky lintel
#

it definitely can if you force it in places where it shouldn’t be

trim junco
#

where should OOP be?

smoky lintel
#

in places where it’s needed lol

trim junco
#

I think you have a lack of understanding of OOP

smoky lintel
#

if you use it improperly you’ll make your code less optimized more verbose and just worse

smoky lintel
#

check my github.

trim junco
#

like I dont think there should be a subclass for everything like some people do, but its also better for things like data ownership

smoky lintel
shell grailBOT
#

studio** You are now Level 11! **studio

trim junco
#

no

#

do you really want me to?

smoky lintel
#

then don’t blindly assume people lack experience because they’re stating an opinion that contradicts yours

trim junco
#

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

smoky lintel
#

plenty of OOP use to prove I’m not incapable of using OOP properly 👍

trim junco
#

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

smoky lintel
#

You gotta be ragebaiting

trim junco
#

nope let me show you

#

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++)

trim junco
#

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

smoky lintel
trim junco
#

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

smoky lintel
#

alr well we aren’t gonna make any progress here, so if you’re happy w it then good for u!

trim junco
#
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

white prawn
trim junco
#

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)