Jump to content

Search the Community

Showing results for tags 'oop'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Blogs

  • Development Blog
  • Canardian's Blog
  • Tyler's Blog
  • macklebee's Blog
  • B-Byrnes' Blog
  • Marleys Ghost's Blog
  • omid3098's Blog
  • Richardsimpo123456's Blog
  • DJDD's Blog
  • Rick's Blog
  • --
  • Economically Disadvantaged
  • klepto2's Blog
  • Old Blog
  • Chris Paulson's Blog
  • Davaris' Blog
  • nil
  • Rekindled Phoenix's Blog
  • Flexman's Blog
  • Kattemaksu Online
  • Niosop's Blog
  • 1299 RTS Game Project
  • Blitzbat's Blog
  • gordonramp's Blog
  • Andy Gilbert's Blog
  • Marcus' Blog
  • JornAggror Blog
  • diedir's Blog
  • wayneg's Blog
  • Masterxilo's Blog
  • peubuy's blog
  • OD Arts -Leadwerks Blog
  • Leadwerks News
  • Dave Lee's Blog
  • The progression......
  • The Progression
  • Pancake's Blog
  • Test Blog
  • Pure³d's Blog
  • dreamhead Blog
  • RVL's Blog
  • DB's Blog
  • Toxin Games Development Blog
  • CombatHelo Blog (RSS Import)
  • Foolish's Blog
  • ZioRed's Corner
  • BLaBZ Blog
  • Toxin Games Twitter
  • Shard - Third Initiative
  • Shard's Blog
  • Soamp's Blog
  • Soamp's Blog
  • Laurens' Blog
  • JT`s warehouse district
  • Kennar's Blog
  • KiteFuchs' Blog
  • KiteFuchs' Blog
  • Eagle's Blog
  • Rachel's Dev-Blog
  • zaphos' Blog
  • please delete this blog
  • Afke's Blog
  • Richard Simpson
  • knowledgegranted's Blog
  • EdzUp(GD)'s Blog
  • aGameLife's Kelasel MMORPG Blog
  • Beyond Civilization Blog Ext
  • tournamentdan's Blog
  • Beyond Civilization Blog
  • smashthewindow
  • AnniXa's Blog
  • AnniXa's Blog
  • Elemental Development
  • Aria's Blog
  • Strogg76's Blog
  • Clackdor's Blog
  • Leadwerks Project Status
  • simpleprogrammer's Blog
  • Pathfinding in LE.2.x
  • Naughty Alien's Blog
  • smashthewindow's Blog
  • Ali Salehi's Blog
  • Jardar's Blog
  • DigitalHax Blog
  • Chris Vossen's Development Blog
  • Scarlet Thread Studios' Blog
  • Kronos' Blog
  • Benton's Blog
  • Screen Size Utility
  • ChrisV's Blog
  • tjheldna's Blog
  • shadmar's Blog
  • 3D Masons, LLC
  • Andy Gilbert's Enviro Models
  • ParaToxic's Blog
  • NarkLord's Blog
  • ChrisMAN's Blog
  • ChrisMAN's Blog
  • CGMan's Blog
  • The Game
  • Chris Tutorials
  • Leadwerks 3 Experience
  • An Alien Saga
  • klepto2 & Leadwerks 3
  • Inside the mind of eternal insomniac
  • josk's Blog
  • xtreampb's Blog
  • Rendering puzzles
  • Shader Development in Leadwerks 3.1
  • 3D Coat : Column game making of
  • Einlander's Blog
  • Ginger George's Blog
  • I have a problem
  • Michael_J's Blog
  • nasamydifol's Blog
  • Digman's Blog
  • noesisGUI
  • Remaining Days
  • test_external_blog
  • SavageDogg38's Blog
  • Built from Ruins
  • The Hunt For Food Blog
  • Crazy Minnow Studio
  • CrazyMinnowStudio
  • Guppy's Blog
  • Evayr's Blog
  • Playing Online
  • DerRidda's Blog
  • Karl's Blog
  • whiterabbit's Blog
  • Tinyboss Games
  • abendkleider's Blog
  • sacguccireplica's Blog
  • Arena
  • Imchasinyou's Blog
  • EVE LBS Studio
  • xtom's Blog
  • Lua is better than you think.
  • mdgunn's Blog
  • Crime Closer
  • lxFirebal69xl's Blog
  • Pump-Action Captain
  • Igor's Blog
  • Dead Anyway
  • Lockdown, going forward.
  • Runenrise and more
  • reepblue's Blog
  • LUA Musings
  • severjack's Blog
  • mikeporter's Blog
  • miko93's Blog
  • Megalocerous' Blog
  • lxFirebal69xl's Blog
  • aiaf's Blog
  • Lostghbear's Blog
  • Wedmer's Blog
  • echo $BLOG_NAME > blog_title.tmpl
  • johnadam111's Blog
  • burgelkat's Blog
  • Charrua's Blog
  • peterpaul's Blog
  • joshmathews' Blog
  • Martin Kearl's Blog
  • Brutile's blog
  • tipforeveryone's Blog
  • Express Lab Games Blog
  • Glushchenko Blog
  • Blueapples' Blog
  • DooMAGE's Blog
  • Structura devblog
  • martyj's Blog
  • Dragonfreak's Blog
  • Brutile's Blog
  • assigmenthelp
  • Case Study Assignment Help
  • How to deal with bad grade ?
  • How to deal with bad grade ?
  • GameDev Blog
  • Marcousik's Creations Blog
  • devcjohnson's Blog
  • devcjohnson's Blog
  • THE WHAT? Blog
  • GUI Editor
  • Phodex Games Blog
  • GUI Tutorial
  • Dwarf Beard
  • The Seventh World
  • The Demurian Scribe
  • The Blog of Yue
  • Snowboarding Development Blog
  • Leadwerks VS Source 2
  • Work in Progress - Scifi PBR Media
  • [C++] First Player game start
  • Ocean: Rendering in Leadwerks 4
  • noob_shaders
  • Ultra App Kit (Advanced Custom Widgets)
  • Poking around
  • Slippy's Corner
  • UltraEngine - Experiences, add-ons and other Stuff
  • Blender tutorials
  • Game Ready Maps
  • Thirsty Panther
  • Ultimate Action Game Controller
  • Ultra Tutorials
  • SCP Dev Blog
  • The Seamless Finish: How Coalescing Agents Perfect Coatings and Paints Globally

Forums

  • Software
    • General Discussion
    • Programming
    • Game Artwork
    • Showcase
    • Suggestion Box
    • Bug Reports
  • Addons

Categories

  • Streams and Events
  • Games
  • Work in Progress

Categories

  • Code
    • Lua
    • C++
  • Environments
  • Heightmaps
  • Materials
    • Abstract
    • Asphalt
    • Brick
    • Concrete
    • Debris
    • Effects
    • Fabric
    • Ground
    • Marble
    • Metal
    • Organic
    • Plaster
    • Rock
    • Roof
    • Sand
    • SciFi
    • Snow
    • Surface Imperfections
    • Tile
    • Wood
  • Models
    • Animals and Creatures
    • Architecture
    • Characters
    • Food
    • Machinery
    • Plants and Vegetation
    • Props
    • Rocks
    • Vehicles
    • Tools
    • Weapons
  • Plugins
  • Skyboxes
  • Sound
    • Music
  • Tools

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Location

Found 1 result

  1. OOP (Object-Oriented Programming) in short: Encapsulation – bundling data and methods that operate on it into objects, controlling access. Abstraction – hiding implementation details, showing only the necessary interface. Inheritance – creating new classes based on existing ones, reusing and extending functionality. Polymorphism – the ability of different classes to be treated through a common interface, with behavior depending on the actual type. Modularity - the property of a system that has been decomposed into internally cohesive but loosely coupled modules. Thats what you currently do, i did improve for lua by my script and thats what Josh wants to destroy for no real reasons instead of doing what i did internally in the Engine. About OOP.lua: It starts before main.lua as script from "Source\Start" and add global functions that allow you to do Inheritance and Interfaces for tables, including components. CreateClass("className", BaseClass) - it needed to make table support interfaces and add parent table if needed to use its variables and methods component:AddInterface("interfaceName") - to add interface's variables and methods. Could be several of them per class. To use in component you just need to do: Monster = CreateClass("Monster") Monster:AddInterface("Killable") Interface scripts should be in Source\Interfaces folder To make one do something like that inside script: return CreateInterface("Killable", { health = 100, team = 0, Kill = function(self) end, IsDead = function(self) return self.health <= 0 end, DamageEffect = function(self, amount, attacker) end, Damage = function(self, amount, attacker) if self:IsDead() then return end self.health = MoveTowards(self.health, 0, amount) self:DamageEffect() if self:IsDead() then self:Kill() end end }) CreateInterface(name, members) - name of interface and vars with functions inside of {} You can make function implementation inside of functions there and use self as self of component, including interface functions and variables Or you can leave function body empty: "DamageEffect = function(self, amount, attacker) end" You can check if entity interface in a very simple way: GetComponentByInterface(entity, "Killable") So for example checking and doing damage for entity in bullet component will looks like that: local pickinfo = world:Pick(pos, nextpos, 0.0, true, Bullet.PickFilter, self.owner) local killable = GetComponentByInterface(pickinfo.entity, "Killable") if killable then killable:Damage(self.damage, entity) end No loops or removing component requires to make proper OOP code already. For comparison it looked like that before in Josh code: if type(pickinfo.entity.health) == "number" then pickinfo.entity.health = pickinfo.entity.health - self.damage for n = 1, #pickinfo.entity.components do if type(pickinfo.entity.components[n].Damage) == "function" then pickinfo.entity.components[n]:Damage(self.damage, entity) end if pickinfo.entity.health <= 0 and type(pickinfo.entity.components[n].Kill) == "function" then pickinfo.entity.components[n]:Kill() end end end And his way requiring copy pasting same functions and vars in every component that you want to make killable or usable for example. And it will not looks much better after removing components anyway: if type(pickinfo.entity.health) == "number" then pickinfo.entity.health = pickinfo.entity.health - self.damage if type(pickinfo.entity.Damage) == "function" then pickinfo.entity:Damage(self.damage, entity) end if pickinfo.entity.health <= 0 and type(pickinfo.entity.components[n].Kill) == "function" then pickinfo.entity:Kill() end end And even if Josh add Damage and health members in every entity (which is just silly), it will be same for anything else and in same time you will loose the most basic thing of modern engines as Component system without getting any real advantages. Source code: https://github.com/Dreikblack/OOP-FPS-Template OOP.zip
×
×
  • Create New...