Help needed with sword action in my Arena
BasGoodboy
Member, PRO Posts: 310
Hey all,
So I made an Arena, in which the player fights against random Gladiator opponents.
The player has 3 options to fight: dagger, sword and crossbow.
The opponent spawns at 3 different locations each so much seconds (closeby, middlefar and far away).
Depending on the opponent's spawning place, the player needs to click the right button (dagger for closeby, sword for middlefar and crossbow for far away). This of course works fine.
But.. I want a bit more difficulty in it. And I want it like if the player clicks the crossbow button, a powerbar spawns which goes up by a bar each second. The moment the player releases the crossbow button, the damage will depend on the powers in the powerbar.
I made the powerbar. I made an integer called 'crossbow power'. The powerbar is an actor which every second will make the crossbow power integer +1.
I made the crossbow button actor like this:
When touch is pressed, spawn powerbar.
When touch is released, change attribute 'gladiatoropponent' to 'gladiatoropponent-crossbowpower'.
But.. this won't work. The powerbar gets spawned, but apparently touch is pressed and touch is released is not possible combinated, and are two separate actions.
Any ideas how I can make the player click the crossbow button, make the power bar spawn and when the player releases the crossbow button, the opponent's health will drop by 'crossbowpower', which I made will go up every second by 1 in the powerbar actor.
Please help.
Best regards,
So I made an Arena, in which the player fights against random Gladiator opponents.
The player has 3 options to fight: dagger, sword and crossbow.
The opponent spawns at 3 different locations each so much seconds (closeby, middlefar and far away).
Depending on the opponent's spawning place, the player needs to click the right button (dagger for closeby, sword for middlefar and crossbow for far away). This of course works fine.
But.. I want a bit more difficulty in it. And I want it like if the player clicks the crossbow button, a powerbar spawns which goes up by a bar each second. The moment the player releases the crossbow button, the damage will depend on the powers in the powerbar.
I made the powerbar. I made an integer called 'crossbow power'. The powerbar is an actor which every second will make the crossbow power integer +1.
I made the crossbow button actor like this:
When touch is pressed, spawn powerbar.
When touch is released, change attribute 'gladiatoropponent' to 'gladiatoropponent-crossbowpower'.
But.. this won't work. The powerbar gets spawned, but apparently touch is pressed and touch is released is not possible combinated, and are two separate actions.
Any ideas how I can make the player click the crossbow button, make the power bar spawn and when the player releases the crossbow button, the opponent's health will drop by 'crossbowpower', which I made will go up every second by 1 in the powerbar actor.
Please help.
Best regards,
Goodboi Gamestudios | Monster Jumper now on the App Store
Comments
Goodboi Gamestudios | Monster Jumper now on the App Store
Goodboi Gamestudios | Monster Jumper now on the App Store
Goodboi Gamestudios | Monster Jumper now on the App Store