Search found 3 matches
- Wed May 18, 2022 9:24 am
- Forum: Support and Development
- Topic: A Confusing OOP Problem
- Replies: 5
- Views: 3091
Re: A Confusing OOP Problem
I solved the problem by using a more Luaesque approach to creating the player object. Instead of using the class library, I created a table for the player object and imported it to playState.lua. Since I want the game to have different states, I need to stick to the OOP approach in some cases, but f...
- Tue May 17, 2022 4:10 pm
- Forum: Support and Development
- Topic: A Confusing OOP Problem
- Replies: 5
- Views: 3091
Re: A Confusing OOP Problem
I believe the issue is in PlayState.lua, you have the following: function beginContact(a, b, collision) -- 3rd argument: contact object created upon collision Char:beginContact(a, b, collision) end function endContact(a, b, collision) Char:endContact(a, b, collision) end when you probably want func...
- Tue May 17, 2022 5:16 am
- Forum: Support and Development
- Topic: A Confusing OOP Problem
- Replies: 5
- Views: 3091
A Confusing OOP Problem
Hello guys, could you help me with a minor OOP related problem? My project returns "objects/Char.lua:89: attempt to index field 'physics' (a nil value)" error. Looks like "self.physics.fixture" in the constructor cannot be perceived by the "if a == self.physics.fixture then&...