Search found 6 matches

by gotokiichi
Mon Feb 17, 2020 1:47 am
Forum: Support and Development
Topic: Object-oriented problem
Replies: 2
Views: 4765

Re: Object-oriented problem

The devil is in the detail. To call into constructors of parent classes you need to call them like so ClassB.super.new( self, x ) This is, because ClassB etc. are class instances and when you use super:new and not use the explicit self of the current scope, you call those upper constructors with th...
by gotokiichi
Sun Feb 16, 2020 3:40 am
Forum: Support and Development
Topic: Object-oriented problem
Replies: 2
Views: 4765

Object-oriented problem

I got rxi's simple OOP library classic.lua from adnzzzzZ's BYTEPATH tutorial, and I tested it with some simple inheritances: Object = require 'classic' ClassA = Object:extend() function ClassA:new(x) self.x = x print(self.x) end ClassB = ClassA:extend() function ClassB:new(x) ClassB.super:new(x) end...
by gotokiichi
Thu Jan 30, 2020 2:05 pm
Forum: Support and Development
Topic: [SOLVED][STI]crash when map:resize
Replies: 8
Views: 6330

Re: [STI]crash when map:resize

Yes, JJSax has correctly identified the source of the problem. To prevent it from happening, you can help the garbage collector a bit, e.g. by adding a collectgarbage() call after the resize. For me it didn't crash, it just became more and more sluggish over time, but the problem disappeared after ...
by gotokiichi
Thu Jan 30, 2020 8:12 am
Forum: Support and Development
Topic: [SOLVED][STI]crash when map:resize
Replies: 8
Views: 6330

Re: [STI]crash when map:resize

Pls forgive a sleepy dog:P I have changed the code and attached the runable love file. You are definitely forgiven. I'll preface this by saying I'm not an expert. But I think I fixed it and I have a theory of why it works. It didn't crash right away and just eventually had the error. I dug into the...
by gotokiichi
Thu Jan 30, 2020 2:36 am
Forum: Support and Development
Topic: [SOLVED][STI]crash when map:resize
Replies: 8
Views: 6330

Re: [STI]crash when map:resize

I'm not seeing anywhere in there where it calls map:resize(). Perhaps you copied over the code that isn't crashing by mistake. It would surely help to see how you're calling it as well. Edit: also let us know what the error you're getting is. Pls forgive a sleepy dog:P I have changed the code and a...
by gotokiichi
Wed Jan 29, 2020 7:59 pm
Forum: Support and Development
Topic: [SOLVED][STI]crash when map:resize
Replies: 8
Views: 6330

[SOLVED][STI]crash when map:resize

I'm using karai17's STI library for my little project. Thanks karai17, it realy helps! But when I try to implement zoom in or out the tiled map, the program just crashes every runtime without any error infomation to me. I have located the error to map:resize. If I delete this line, everything's ok a...