Freeze Highlights (for emphasis)

Share and discuss custom LunaLua code and content packs for SMBX2.

Moderator: Userbase Moderators

Emral
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9890
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Phoenix

Freeze Highlights (for emphasis)

Postby Emral » 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
Buster Beetle
Buster Beetle
Posts: 92
Joined: Sun Jan 02, 2022 4:25 pm
Flair: e
Pronouns: she/they
Contact:

Re: Freeze Highlights (for emphasis)

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

really think this lloks cool.

IttaBaby
Bot
Bot
Posts: 55
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?

Emral
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9890
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Phoenix

Re: Freeze Highlights (for emphasis)

Postby Emral » 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

lugiaTheAntarticLord
Bob-Omb
Bob-Omb
Posts: 23
Joined: Wed Jun 10, 2020 3:24 pm

Re: Freeze Highlights (for emphasis)

Postby lugiaTheAntarticLord » Thu Oct 05, 2023 10:05 pm

Ow my eyes

Pjerun
Shy Guy
Shy Guy
Posts: 8
Joined: Sat Jun 25, 2022 4:58 am
Flair: SMBX Enjoyer
Pronouns: any
Contact:

Re: Freeze Highlights (for emphasis)

Postby Pjerun » Mon May 12, 2025 3:52 pm

perfect for some kind of critical hit. Or dealing a final blow to a boss!


Return to “LunaLua”

Who is online

Users browsing this forum: AlphaBlue1011 and 2 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari