This is an extended version of the Rock Paper Scissors game, where two Kniwwelinos communicate with each other to give feedback who has won: the RGB LED lights up in green for the winner, in red for the loser, and in blue in case both are equal.
Kniwwelino on start
to store your score and the one of your friend: myScore
and yourScore
.yourScore
to the topic used by your friend to send his/her score: GAME/friendA
.myScore
) is calculated randomnly and send via a message to the topic GAME/friendB
.myScore
and yourScore
) and color it in blue (if equal), green (if you won), or red (if your friend won).friendA
with friendB
, and vice-versa for the topics. Your friend then attaches a variable to topic GAME/friendB
, and sends the own score to topic GAME/friendA
.
This is the entire solution for one of the players. For the second player, just replace friendA
with friendB
and vice-versa.
Open project in KniwwelinoBlockly