Search found 2 matches

by allfalldown
Mon Sep 30, 2019 4:25 am
Forum: Support and Development
Topic: Speed of getters/setters as opposed to average variable access?
Replies: 3
Views: 1591

Speed of getters/setters as opposed to average variable access?

So currently, I'm making a simple wrapper class, PhysicsObject (just to make handling it easier), for all three important physics objects needed for something in Love2D - the fixture, shape, and body. As one might expect, there will be a few cases where I'll need to directly access the separate obje...
by allfalldown
Sun Aug 25, 2019 2:31 am
Forum: Support and Development
Topic: Performance of metatable-based inheritance for entity classes?
Replies: 4
Views: 1587

Performance of metatable-based inheritance for entity classes?

To keep things nice and tidy, I was thinking of creating a bit of a hierarchy of "classes" for all my entities in my game. Basically, using setmetatable, .__index, and related functions/setups with tables, I'd make a base "entity" class that would handle collision and what not; from this, I'd make a...