so far I’m trying to add a score, so amount of coins collected, and player take damage from the flying pigs.
then also health regeneration from jerry cans.
but I’m not sure what to do.
Picture of the game
so far I’m trying to add a score, so amount of coins collected, and player take damage from the flying pigs.
then also health regeneration from jerry cans.
but I’m not sure what to do.
Picture of the game
Can you share the wick file?
Yeah, I will share it
edit: I cant share it, since I am new I cant upload attachments
Then can you post the code?
Whats a code?
Oh to make those features you need to script them in javascript
ohh right, can I send you the file over email? or gmail?
alright i sent you an email
I didn’t get anything
thats weird, ill send it again
Ok I sent it again
Part C3-17-2021_14-39-43.wick (79.9 KB)
Unfortunately I’m not the best at coding so maybe @pumpkinhead @awc95014 or @Jovanny could help?
Okay thank you
Well i can break this down into 2 steps for you if you want to do this in the future.
A way to detect when a coin is hit is to use hit triggers. Here are some steps to use them.
if (this.hits(coin)) {
project.score += 1;
};
scoreCount.setText("Score: " + project.score)
This sets the counter to our score value whenever it goes up.
And theoretically you should be done.
If this doesn’t work for you, I got most of this from Luca’s tutorial. Watch it here!
Hi @evilmeap12, welcome to our forums:
Here is a tutorial for collectibles, you could do a similar thing:
For the health bar, you could also do something similar to this, but instead of hitting the button, you will apply the logic when you collide with the jerry cans.
Hope this helps.
thank you I will try it when I get home
Thank you, I got the score working now :D
I do like the Bar but im having a hard time because of collision. When the pig hits the plane I want to plane to lose health. the collision is what is hard for me, im not sure what to do.
under plane update script tab write the following:
if(this.hits(pig)) {
// lose health
}
Replace the comment by the logic for losing health.