Help on mathematics

I made another query.

This works now completely with ALL situations.

Note: Team B always shoots second.

Thanks to the community for helping me, especially @CBVG
@jojobeerten
@Peter for moderate this

1 Like

Maybe you want also check my little penalty game:

penalty_game.aia (7.6 KB)

4 Likes

another good solution.

if ScoreA > Score B + Remaining Shots.

But I have one more question: If I call the process ShootA, then the rest of the code in the Button1.Click block then waits until the process ShootA is finished or does it continue at the same time? I need a result from ShootA, with which the Button1.click block then continues to work. What if the process takes longer due to a timer etc.? I have to implement that later, so that the player can not delay his shot forever. And if the result of ShootA is not yet available, does it falsify the part in Button1.Click that comes below the Call.ShootA?

From now on, I will focus on nice animations, good menu navigation, understandable and intuitive usability and multiplayer capabilities. In a few weeks / months, the app goes online and my dream comes true.

Yes, use a timer with countdown (e.g. 10 sec). If the time runs out, this counts as a failed attempt.

1 Like

I mean at your block When button1.click

There is this part:

This part doesn’t wait for the result of the call.shoot_A process. What happens, if a timer delays the result of the shoot_A process. What value does the ongoing process in “when Button1.click” take as the basis for the global goal_A ?

When the timer should be active (enabled), you have to decide for yourself. When the time is up, Button1 is disabled and the penalty is counted as a failed attempt.

Each penalty kick is released by the referee with a whistle. So add a sound component. As soon as this whistle sounds, the timer / countdown is started.

1 Like

Thanks so far. The App ist already completed in my head. You did not understand what I meant. Your idea of the penalty shootout blocks are good but with a timer component it is not working as intentioned.
anyway thanks for the ideas and concepts

So please explain it exactly. What does not work as intended?
How should the game run?

Okay, maybe there was a misunderstanding and I didn’t express myself clearly enough.

The code I was looking for is done (mainly thanks to @CBVG) and adapted to my needs. It is already running exactly as requested.

Afterwards I was only related to the block you suggested (which is also very good of course), but it does not work if a timer is installed. In my opinion, I have shown that well enough.

So again: Thanks to all who were very helpful here and have brought me a significant step closer to my Penalty app.

This thread can be closed.

Try this:

penalty_game2.aia (12.3 KB)

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.