How to add Special attack in platformer game

I want to make a special attack for player. But that special attack is used only once in a game level.
Also that special attack is enable when player have 50 gamecoins in the game. Otherwise the special attack cannot be enable and used.
Actually the special attack is traded with the 50 gamecoins (u can buy it from inventory with the gamecoins).

How can I achieve the above.

1 Like

you can use a scene variable to check if there is a special attack available.
Foe example at beginning of scene set value of this variable to 0
when you buy it set to 1 and when used ser to -1

@xisco
ThanksšŸ™. It worked.

Question 2:
The gamecoins are earned when player watchs an ads(say 10 coins per ads watched). So player will have to watch 5 ads to earn 50 gamecoins. These gamecoins are then used to buy that special attack.
How to code this, gamecoins earned by watching ads and then buying that special attack.(player must watch 5 ads to have 50 gamecoins)

well there are ads events, you will need and admob account. I only use banners, so I donā€™t know how reward videos work, i want to test it.
My guess, you need a global variable and increase +10 each time you show a video to the player, when it is 50 show a button tu buy the attack

Thanks :pray:.
Itā€™s done.

@xisco
How can I add touch control button to my special attack. So when the player touches the touch button, game character uses it.

there is an event for touch/mouse button down o release

Sorry didnā€™t notice thatšŸ˜….
Thanks it done.