Coroutines with arguments

Post here for help and support regarding LunaLua and SMBX2's libraries and features.

Moderator: Userbase Moderators

baenyth
Koopa
Koopa
Posts: 16
Joined: Mon Sep 07, 2020 6:34 pm
Pronouns: she/her

Coroutines with arguments

Postby baenyth » Sun Sep 13, 2020 12:45 am

I'm trying to make a function that keeps on giving coins to a block when hit called keepCoins, and it has an argument called index, which is the index of the block. Since the function is meant to be used on a timer, I'm trying to use coroutines to keep it timed, but there are no functions for coroutine timers with agruments, I checked. I tried putting the argument in the function argument, but that didn't work. Is there any way to run a coroutine with arguments, or do I have to do something else?

Thanks in advance.

Hoeloe
Phanto
Phanto
Posts: 1465
Joined: Sat Oct 03, 2015 6:18 pm
Flair: The Codehaus Girl
Pronouns: she/her

Re: Coroutines with arguments

Postby Hoeloe » Sun Sep 13, 2020 11:36 am

You absolutely can just provide arguments to Routine.run.


Return to “LunaLua Help”

Who is online

Users browsing this forum: No registered users and 1 guest

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari