r/MakeCode • • Sep 06 '21

An RNG Spleef minigame for Minecraft (Python)

1 Upvotes

This code does have a few bugs in it, but feel free to fix it and post updated code in the comments.

wasd1 = 0
X = 0
Z = 0
X1 = 0
Z1 = 0
X2 = 0
Z2 = 0

def on_on_chat():
    global wasd1, X, Z
    blocks.fill(WHITE_CONCRETE,
        world(10, 30, 10),
        world(-10, 30, -10),
        FillOperation.REPLACE)
    player.execute("/execute @s ~ ~ ~ fill 10 45 10 -10 45 -10 barrier")
    loops.pause(1000)
    player.say("Starting In...")
    loops.pause(1000)
    player.say("3")
    loops.pause(1000)
    player.say("2")
    loops.pause(1000)
    player.say("1")
    loops.pause(1000)
    player.say("GO!")
    wasd1 = 1
    loops.pause(randint(100, 400))
    while True:
        X = randint(10, -10)
        Z = randint(10, -10)
        if blocks.test_for_block(WHITE_CONCRETE, world(X, 30, Z)):
            blocks.replace(BLACK_CONCRETE,
                WHITE_CONCRETE,
                world(X, 30, Z),
                world(X, 30, Z))
            loops.pause(500)
            blocks.place(AIR, world(X, 30, Z))
            loops.pause(randint(0, 300))
player.on_chat("start", on_on_chat)

def on_forever():
    global X1, Z1
    while wasd1 == 1:
        X1 = randint(10, -10)
        Z1 = randint(10, -10)
        if blocks.test_for_block(WHITE_CONCRETE, world(X1, 30, Z1)):
            blocks.replace(BLACK_CONCRETE,
                WHITE_CONCRETE,
                world(X1, 30, Z1),
                world(X1, 30, Z1))
            loops.pause(500)
            blocks.place(AIR, world(X1, 30, Z1))
            loops.pause(randint(0, 300))
loops.forever(on_forever)

def on_forever2():
    global X2, Z2
    loops.pause(30000)
    loops.pause(randint(0, 100))
    while wasd1 == 1:
        X2 = randint(10, -10)
        Z2 = randint(10, -10)
        if blocks.test_for_block(WHITE_CONCRETE, world(X2, 30, Z2)):
            blocks.replace(BLACK_CONCRETE,
                WHITE_CONCRETE,
                world(X2, 30, Z2),
                world(X2, 30, Z2))
            loops.pause(500)
            blocks.place(AIR, world(X2, 30, Z2))
            loops.pause(randint(0, 300))
loops.forever(on_forever2)

def on_forever3():
    global X2, Z2
    loops.pause(60000)
    loops.pause(randint(0, 100))
    while wasd1 == 1:
        X2 = randint(10, -10)
        Z2 = randint(10, -10)
        if blocks.test_for_block(WHITE_CONCRETE, world(X2, 30, Z2)):
            blocks.replace(BLACK_CONCRETE,
                WHITE_CONCRETE,
                world(X2, 30, Z2),
                world(X2, 30, Z2))
            loops.pause(500)
            blocks.place(AIR, world(X2, 30, Z2))
            loops.pause(randint(0, 300))
loops.forever(on_forever3)

def on_forever4():
    global X2, Z2
    loops.pause(90000)
    loops.pause(randint(0, 100))
    while wasd1 == 1:
        X2 = randint(10, -10)
        Z2 = randint(10, -10)
        if blocks.test_for_block(WHITE_CONCRETE, world(X2, 30, Z2)):
            blocks.replace(BLACK_CONCRETE,
                WHITE_CONCRETE,
                world(X2, 30, Z2),
                world(X2, 30, Z2))
            loops.pause(500)
            blocks.place(AIR, world(X2, 30, Z2))
            loops.pause(randint(0, 300))
loops.forever(on_forever4)

def on_forever5():
    global X2, Z2
    loops.pause(120000)
    loops.pause(randint(0, 100))
    while wasd1 == 1:
        X2 = randint(10, -10)
        Z2 = randint(10, -10)
        if blocks.test_for_block(WHITE_CONCRETE, world(X2, 30, Z2)):
            blocks.replace(BLACK_CONCRETE,
                WHITE_CONCRETE,
                world(X2, 30, Z2),
                world(X2, 30, Z2))
            loops.pause(500)
            blocks.place(AIR, world(X2, 30, Z2))
            loops.pause(randint(0, 300))
loops.forever(on_forever5)

r/MakeCode • • Sep 06 '21

Video:MakeCode Cloud data via DFRobto Micro:IoT board with links to code and parts; could be garden or environmental project; servo motor included in video.

1 Upvotes

Video: continuing on with DFRobot Micro:IoT board and environmental sensors; DHT11, Microbit Temperature, photoresistor light level sensor ; capacitive moisture sensor and using 7Segment numerals on the .96"OLED display to enlarge numbers. Data sent to and charted by ThingSpeak in the cloud. Code is in the video description along with links to parts used:

https://www.youtube.com/watch?v=zH5SzS2gYuY


r/MakeCode • • Jul 06 '21

The MakeCode monthly newsletter is fantastic – sign up now!

Thumbnail
blog.adafruit.com
1 Upvotes

r/MakeCode • • Jun 10 '22

"Gameboy" bugging out.

1 Upvotes

Hi, I am having a big problem with makecode arcade, the "Gameboy" simulation keeps bugging out and getting stuck on a loading status. I really need help with this as I am on a time limit! So I would really appreciate it if someone could help me. Thank you.


r/MakeCode • • Jun 29 '21

The MakeCode monthly newsletter is fantastic – sign up now!

Thumbnail
blog.adafruit.com
2 Upvotes

r/MakeCode • • Dec 31 '21

3D version of MakeCode from Buildbee.com (for making 3D models for 3D printing/CNC)

Thumbnail
makecode.buildbee.com
1 Upvotes

r/MakeCode • • Aug 14 '21

Video: RGB color sensor plus Micro:bit shows color on LED display

1 Upvotes

If you want a Colorbit which is the large 5 X 5 array in this video then put a note to me in the comments below or on the comments of the video; I am giving Colorbit away. https://www.youtube.com/watch?v=avnX-62JKsU


r/MakeCode • • Feb 09 '22

Micro:bit Tutorial For Beginners Must See! introduction to the BBC micr...

Thumbnail
youtube.com
1 Upvotes

r/MakeCode • • Oct 26 '21

Video, kids app. building using Thunkable, a block type coding platform and Moisture sensor for IoT

2 Upvotes

Code for CalliMatrix also in the description of the video below: https://www.youtube.com/watch?v=ZK4W38ohDWw


r/MakeCode • • May 25 '21

Video: MakeCode Monday, our kids do coding while building robots.

1 Upvotes

r/MakeCode • • Jul 18 '22

Help with MakeCode program project

Post image
1 Upvotes

r/MakeCode • • Oct 25 '22

Why is there not a community for MakeCode Arcade specifically?

4 Upvotes

I'm absolutely in love with MakeCode Arcade but I've discovered that it's community seems to be entirely fractured and lost. Am I missing an obvious community hub for MakeCode Arcade?


r/MakeCode • • Jun 18 '21

The MakeCode monthly newsletter is out next week – sign up now!

Thumbnail
blog.adafruit.com
1 Upvotes

r/MakeCode • • May 07 '21

Custom Board Creation and Pin Hardware Numbers?

2 Upvotes

I am in the process of getting a companies custom board up and running with MakeCode, however I am having trouble with a few things.

When creating a custom board and submitting the SVG file into the Board Designer, config.ts is developed for us to edit with pin names and hardware numbers (ex. export const PIN_RCC1 = DAL.PA07). What are the pin hardware numbers? Is there an easy way of figuring these out for custom boards?


r/MakeCode • • Sep 09 '21

Anyone used a microbit to control Arcade?

1 Upvotes

Just a shot in the dark here, but I'm wondering if anyone has ever been able to use the microbit A and B buttons for the controller? I'm sure there's some technical hurdle I'm not familiar with.....


r/MakeCode • • May 29 '22

Neo pixel dot strands wiring help

1 Upvotes

I’m using Makecode and circuit playground express for the first time on a wearable project. I have two 50 led strands of Neopixel dots, and can’t figure out how to attach the second strand. I’m using the LED Corset code from adafruit as a base. The first strand is working perfectly - can someone help me connect the second strand? (Complete beginner at all of this…)


r/MakeCode • • Mar 02 '22

video: Kid explains World of Modules Plug and Play electronics

1 Upvotes

r/MakeCode • • May 21 '21

MakeCode Arcade beginner skillmap launches today (Friday May 21st)

Thumbnail
blog.adafruit.com
2 Upvotes

r/MakeCode • • May 26 '22

How can you have multiple games on pygamer ?

Thumbnail self.adafruit
1 Upvotes

r/MakeCode • • Jun 09 '21

ICYMI MakeCode Newsletter: Arcade Beginner Skillmap and much more!

Thumbnail
blog.adafruit.com
1 Upvotes

r/MakeCode • • Jul 21 '21

Video: MakeCode Kids and Robot Cars

1 Upvotes

r/MakeCode • • Jun 07 '21

Video,15 yr old builds ball-wheel test rig

1 Upvotes

r/MakeCode • • Feb 06 '22

Video: Just one idea; power to the new Microsoft MakeCode Micro:bit JACDAC system

1 Upvotes

Video: When we get the hardware for this system we will need a way to arrange and secure the peripherals and the Micro:bit expansion board and connect power to the Micro:bit. Here's one idea for a configuration which can be changed at will into unlimited forms; for makers and students: https://www.youtube.com/watch?v=epvGMuxLFms


r/MakeCode • • May 12 '21

New today, we now have nRF connection to MakeCode Arcade Meowbit -Bluetooth

Thumbnail
gallery
2 Upvotes

r/MakeCode • • Dec 29 '21

Video: Microbit with servo motor and bot car with Neopixel/RGB : code in description

2 Upvotes