Football Racing

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.

Check out this, is it what you want?

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

  • That can be done by check how many players overlaping with the finish line when first player finishing.
    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.
    if (overlapDealed) return 
    overlapDealed = true

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.

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!

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

1 Like