Would you like to play a game?
-
Just created my first game in UIFlow called reaction.
This is a 2 player game built in just UIFlow.
Here is the micropython codefrom m5stack import * from m5ui import * from square import Square clear_bg(0x111111) emoji = Square(7, 7, 15, 9, lcd) btnA = M5Button(name="ButtonA", text="Player 1", visibility=True) btnB = M5Button(name="ButtonB", text="Start", visibility=True) btnC = M5Button(name="ButtonC", text="Player 2", visibility=True) import random while True: wait(1) wait(random.randint(0, 4)) emoji.show_map([[0,0,0,0,0,0,0],[0,1,1,1,1,1,0],[0,1,1,0,1,1,0],[0,1,0,1,0,1,0],[0,1,1,0,1,1,0],[0,1,1,1,1,1,0],[0,0,0,0,0,0,0]], 0xFF0000) wait(1) lcd.clear() while (buttonA.wasReleased()) and (buttonC.wasReleased()): wait(1) if buttonA.wasPressed(): emoji.show_map([[0,0,0,1,0,0,0],[0,0,1,1,0,0,0],[0,1,1,1,0,0,0],[1,1,1,1,1,1,1],[0,1,1,1,0,0,0],[0,0,1,1,0,0,0],[0,0,0,1,0,0,0]], 0x33cc00) if buttonC.wasPressed(): emoji.show_map([[0,0,0,1,0,0,0],[0,0,0,1,1,0,0],[0,0,0,1,1,1,0],[1,1,1,1,1,1,1],[0,0,0,1,1,1,0],[0,0,0,1,1,0,0],[0,0,0,1,0,0,0]], 0x3366ff) wait(1) lcd.clear() wait(0.001) -
@ajb2k3
Expect -
@watson huh?
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login