Help needed with sword action in my Arena

BasGoodboyBasGoodboy Member, PRO Posts: 310
edited September 2013 in Working with GS (Mac)
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,

Goodboi Gamestudios | Monster Jumper now on the App Store

Comments

  • BasGoodboyBasGoodboy Member, PRO Posts: 310
    Nobody knows? :(

    Goodboi Gamestudios | Monster Jumper now on the App Store

  • KevinCrossKevinCross London, UKMember Posts: 1,894
    What about touch is inside, instead of touch is pressed, try that with release too.
  • BasGoodboyBasGoodboy Member, PRO Posts: 310
    @KevinCross I will try wednesday! I'm on a three-day-intern-course for my job now. Thanks for the advice, hopefully it will work but I'm honestly afraid it won't.

    Goodboi Gamestudios | Monster Jumper now on the App Store

  • BasGoodboyBasGoodboy Member, PRO Posts: 310
    @KevinCross great man! Touch inside and release works perfect! Whoah! [SOLVED]

    Goodboi Gamestudios | Monster Jumper now on the App Store

  • KevinCrossKevinCross London, UKMember Posts: 1,894
    It was a lucky guess. Congrats on getting it solved
Sign In or Register to comment.