# Football Racing

**URL:** <https://forum.makecode.com/t/football-racing/13081>\
**Category:** Help\
**Tags:** game\
**Created:** [April 12, 2022, 4:44pm UTC](https://forum.makecode.com/t/football-racing/13081 "2022-04-12T16:44:22Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![brandodon](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/brandodon/32/3625_2.png) [@brandodon](https://forum.makecode.com/u/brandodon)\
**Post date:** [April 12, 2022, 4:44pm UTC](https://forum.makecode.com/t/football-racing/13081/1 "2022-04-12T16:44:22Z")

</div>

This is a pretty old game that I just gave up on because it got too hard for me, but if anyone knows the reason it doesn’t work correctly, just tell me. I would love for this game to be finished since its so simple.

> **[Football Racing but its sadly broken ;(](https://arcade.makecode.com/78590-43601-90997-83788)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

**Author:** ![AqeeAqee](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/aqeeaqee/32/5424_2.png) [@AqeeAqee](https://forum.makecode.com/u/AqeeAqee)\
**Post date:** [April 18, 2022, 5:38pm UTC](https://forum.makecode.com/t/football-racing/13081/2 "2022-04-18T17:38:38Z")

</div>

Check out this, is it what you want?

> **[Football Racing but its sadly broken ;(](https://arcade.makecode.com/67283-86420-59834-20360)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

**Author:** ![brandodon](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/brandodon/32/3625_2.png) [@brandodon](https://forum.makecode.com/u/brandodon)\
**Post date:** [April 19, 2022, 5:44pm UTC](https://forum.makecode.com/t/football-racing/13081/3 "2022-04-19T17:44:19Z")

</div>

Yeah perfect! Only thing is, how do I detect a tie?

---

<div class="post-metadata">

**Author:** ![AqeeAqee](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/aqeeaqee/32/5424_2.png) [@AqeeAqee](https://forum.makecode.com/u/AqeeAqee)\
**Post date:** [April 19, 2022, 9:03pm UTC](https://forum.makecode.com/t/football-racing/13081/4 "2022-04-19T21:03:12Z")

</div>

- That can be done by check how many players overlaping with the finish line when first player finishing.

```auto
    const tiePlayers = sprites.allOfKind(SpriteKind.Player).filter(s=>s.overlapsWith(finishLine))

```

then if tiePlayers.length\>1, it’s a tie

- And add flowing at beginning of overlap event, for it can fire multi times(each player finished), we need only once. Or, info.score will be set in the scene of splash, that cause a big mess.

```auto
    if (overlapDealed) return 
    overlapDealed = true

```

> **[Football Racing but its sadly broken ;(](https://arcade.makecode.com/56353-73140-62393-86604)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

**Author:** ![brandodon](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/brandodon/32/3625_2.png) [@brandodon](https://forum.makecode.com/u/brandodon)\
**Post date:** [April 21, 2022, 4:34pm UTC](https://forum.makecode.com/t/football-racing/13081/5 "2022-04-21T16:34:45Z")

</div>

> [@AqeeAqee](#):
>
> [https://arcade.makecode.com/56353-73140-62393-86604](https://arcade.makecode.com/56353-73140-62393-86604)

The tie works but the only problem is that it doesn’t check for the finishing player so if two other players tie before you win, then you don’t lose money.

---

<div class="post-metadata">

**Author:** ![AqeeAqee](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/aqeeaqee/32/5424_2.png) [@AqeeAqee](https://forum.makecode.com/u/AqeeAqee)\
**Post date:** [April 21, 2022, 4:52pm UTC](https://forum.makecode.com/t/football-racing/13081/6 "2022-04-21T16:52:55Z")

</div>

Yeh, you are right.  
It just implement the tie as a demo, add your any logic based on it would be easy. For example, check selected player overlaping with finish when the tie occuring.  
Good luck!

---

<div class="post-metadata">

**Author:** ![brandodon](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/brandodon/32/3625_2.png) [@brandodon](https://forum.makecode.com/u/brandodon)\
**Post date:** [April 21, 2022, 9:37pm UTC](https://forum.makecode.com/t/football-racing/13081/7 "2022-04-21T21:37:57Z")

</div>

Thank you so much for your help! I really appreciate it!
