Freeze Highlights (for emphasis)

Share and discuss custom LunaLua code and content packs for SMBX2.
Enjl
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9491
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Orphion Egamalenitar Osmos IV, Esq.

Freeze Highlights (for emphasis)

Postby Enjl » Mon Dec 21, 2020 2:37 am

https://drive.google.com/file/d/18NA8n9 ... sp=sharing

Image

Little library from Subzero Heroes that lets you add a short time freeze for emphasis when, for example, hitting an enemy with a powerful attack.

Usage example is in the file. It's not much more than a single line of code. There's also a getter function if you wanna check for when a timefreeze is active.

ditditdit
Swooper
Swooper
Posts: 52
Joined: Sun Jan 02, 2022 4:25 pm
Flair: Ditditdit: destroyer of good episodes
Contact:

Re: Freeze Highlights (for emphasis)

Postby ditditdit » Fri May 20, 2022 1:23 pm

really think this lloks cool.

IttaBaby
Fighter Fly
Fighter Fly
Posts: 44
Joined: Sat Apr 08, 2017 8:19 pm

Re: Freeze Highlights (for emphasis)

Postby IttaBaby » Sun May 29, 2022 7:32 am

So is there a simpler way to make it only happen during an enemy kill and not every time anything despawns for any reason including every coin collected and every time a projectile goes of screen?

Enjl
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9491
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Orphion Egamalenitar Osmos IV, Esq.

Re: Freeze Highlights (for emphasis)

Postby Enjl » Sun May 29, 2022 8:11 am

IttaBaby wrote:
Sun May 29, 2022 7:32 am
So is there a simpler way to make it only happen during an enemy kill and not every time anything despawns for any reason including every coin collected and every time a projectile goes of screen?
Yes! You can call the freeze.set() function whenever you need to. You don't have to use the condition-less onPostNPCHarm-example from the file. For enemy kills, make sure to use the parameters for onPostNPCKill and filter out harmType 9 (despawn) with an if statement. You can also filter for IDs with the killedNPC paramter:
https://docs.codehaus.moe/#/reference/lunalua-events

example: this one only freezes when an npc was killed with a JUMP
function onPostNPCKill(killedNPC, killReason)
if killReason == HARM_TYPE_JUMP then
freeze.set(10)
end
end


Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 1 guest