Need help with a game

hello, I know I’ve been asking a lot from you guys, do you think you can help me with this.

  • when the energy bar reaches zero you die
  • when the plane dies you go to the next frame

I also managed to get the regeneration from the jerry cans to work but it just needs to be set on a limit so it doesn’t go over 100.

Part C3-24-2021_17-44-41.wick (152.4 KB)

Thank you.

I added 2 lines ot the update script of the plane to make it go to the next frame when the energy bar reaches zero

if(this.energy<=0)
gotoNextFrame();

Here’s the project:
Part C3-24-2021_18-33-11.wick (152.5 KB)

Let me know if this is what you needed?

1 Like

Yup, Thank you so much.
And also the jerry cans so the regeneration doesn’t pass 100. If I keep collecting jerry cans it will add up and keep adding up, I just want it too add up to 100 then stop.

Just one more question how do I make the score appear on the 3rd frame?

You can make the score appear on same three using the same code you had on frame 2:

scoreCounter.setText("Score " + project.score)

(You’ll just need to have a text object named “scoreCounter” on frame 3 for this to work)

Try this: Part C3-24-2021_18-51-20.wick (152.7 KB)

1 Like

yup, that’s it, Thank you for helping me, I really appreciate it.

1 Like

Hello again, sorry to bother you, for the game when I die and I go to back to main menu, and I click play the game is still running, like it doesn’t reset, do you think you can help me with this?

Thank you.

Part C3-26-2021_17-03-37.wick (352.3 KB)

I’m always happy to help, here’s the file:
Part C3-26-2021_17-22-04.wick (352.3 KB)

I added this in the default script of the objects that get cloned:

if(!this.isClone)
for (var eachClone of this.clones){
    eachClone.remove();
}

This way, all of their clones get removed when entering the frame.

Also, the health did reset, but the scaleX of the bar only reset when the plane was damaged, so I added this in the update script of the plane:

energyBar.scaleX = this.energy/this.max;

Let me know if it works :+1:

Yup, it works, thank you. I really appreciate it

1 Like

Hello Hamzah, For my game I am adding sound, I added background music to it, and pig noises, I’m still working on the noises. what I need help with is the coins. The MP3 file is called (Coin.mp3) its in the wick file. I was having trouble with the coins, would I want is when the player collects the coin I want the Coin.mp3 to play.

If you need anything just let me know.

Thank you.

Part E 4-7-2021_14-56-45.wick (3.6 MB)

You could use hits triggers to do it, like put this in the coin’s update script

if (this.hits (player)) {
playSound(“Coin.mp3”)
}

1 Like

Hi @evilmeap12, I hope this helps:
Part E 4-7-2021_15-09-20.wick (3.6 MB)

I changed the code in the coin’s update script a bit so that it makes the sound when it gets removed

let me know if this is what you needed :+1:

Yup thank you, exactly what I needed.

1 Like