Thanks again, that makes sense.
I understand what is supposed to happen (I think?) - But I must be missing something fundamental about the playdate.timer.performAfterDelay works because I have for the past 2 hours been googling and trying all possible variations of it.
Since the function I want to run to start the delay timer is self:transition(), and that should then do self.BgBlackFillSprite:remove() after 2000 ms- the below line makes sense to me, but it won't compile.
playdate.timer.performAfterDelay(2000, self:transition() self.BgBlackFillSprite:remove() end)
playerSelector.lua:222: ')' expected near 'self'
the above line being 222
I checked here: A list of helpful libraries and code - #96 by frankbsad as well which does something very similar, and to me I cannot see the error in my line of code.
The documentation also doesn't help much in this case for a complete newcomer to the world of coding Inside Playdate
I tried to break it down and eliminate possible errors in references or whatnot in my script:
function sampleFunction()
print('hello')
end
playdate.timer.performAfterDelay(2000, sampleFunction() print('did it work?') end)
But, here I get the error: "')' expected near 'print'"
(I have had many instances in the process of making this little counter where I wanted a delay but have put it off, or found some workaround because I just seem to keep hitting a wall hehe)