Page 1 of 1

How do you make power-ups have a time limit?

Posted: 9 Oct 2020, 20:09
by Omega02
For example, if Mario gets the Fire Flower, he would only have it for a certain amount of time before losing it.

Posted: 9 Oct 2020, 21:03
by Victor ManuelMR
OfficialJC02 wrote:For example, if Mario gets the Fire Flower, he would only have it for a certain amount of time before losing it.

Code: Select all

dim timer as double

do
if char(1).status = 3 then timer += 1

if timer > 400
   char(1).status = 2
   timer = 0
end

call sleep(1)
loop

Posted: 9 Oct 2020, 22:35
by Omega02
I have 2 questions:

1. How do I add music while Mario is Fire Mario? (The music from Super Mario Galaxy)
2. How do I keep Mario from losing the power-up when he gets hit but still takes damage?

I know it’s a lot to ask, but this will help me a lot with other scripts as well.

Posted: 23 Nov 2020, 2:04
by FyreNova
OfficialJC02 wrote:I have 2 questions:

1. How do I add music while Mario is Fire Mario? (The music from Super Mario Galaxy)
2. How do I keep Mario from losing the power-up when he gets hit but still takes damage?

I know it’s a lot to ask, but this will help me a lot with other scripts as well.
  • use events; you can find the needed function here.
  • Code: Select all

    dim timer as double

    do
    if char(1).status = 3 then timer += 1

    if timer > 400
       char(1).status = 2
       timer = 0
       if char(1).status <> 3
       char(1).status = 3
       char(1).hitpoint -= 1
       end if
    end if

    call sleep(1)
    loop