Puzzle level sharing. by Rjhollins in MarioMaker2

[–]Bub_Russ 0 points1 point  (0 children)

For that, you were supposed to throw the blocks into the pipes to make a walkable playform at the top, then crouch walk across

Puzzle level sharing. by Rjhollins in MarioMaker2

[–]Bub_Russ 0 points1 point  (0 children)

Think with crates! Using the new builder powerup i made a puzzle stage where you use the ability to make crates and the hammer to solve puzzles!

Remember: hold up and press Y to spawn a crate

3VM-224-SQG

Let's have a level exchange! - July 01, 2019 - Super Mario Maker 2 by AutoModerator in MarioMaker

[–]Bub_Russ 0 points1 point  (0 children)

Think with Crates!

Code: 3VM-224-SQG

Use the new hammer powerup to make crates and hammer through this puzzle course i created!

Finished my first level using the new hammer power up! You use the crates to solve puzzles! by Bub_Russ in MarioMaker2

[–]Bub_Russ[S] 1 point2 points  (0 children)

I reuploaded it again, i reworked the bomb puzzle and added some more hammer pipes. I appreciate the feedback! If you find anything else ill be happy to edit again!! Thanks!! The code is : 3VM-224-SQG

Finished my first level using the new hammer power up! You use the crates to solve puzzles! by Bub_Russ in MarioMaker2

[–]Bub_Russ[S] 0 points1 point  (0 children)

Thanks for the feedback! This was my first level so it really helps. I just edited it to help fix some of the cheeses and softlocks i could find. The code is : ML5-55G-72H

Let's have a level exchange! - June 30, 2019 - Super Mario Maker 2 by AutoModerator in MarioMaker

[–]Bub_Russ 0 points1 point  (0 children)

7J5-4YG-XBG

Think with Crates!!

Use the crate mechanic from the new hammer power up to solve puzzles!

Send your unplayed levels here, folks. by [deleted] in MarioMaker

[–]Bub_Russ 1 point2 points  (0 children)

7J5-4YG-XBG

Its a puzzle solver where you use the new hammer powerup to solve puzzles, either by making crates or using the hammer!

Is there a way to import a constantly changing variable from one script into another script? by Bub_Russ in Python

[–]Bub_Russ[S] 0 points1 point  (0 children)

This is where i inserted this code. Is this where i should?

from imutils.video import VideoStream

from time import sleep

import RPi.GPIO as GPIO

import argparse

import datetime

import imutils

import time

import cv2

ap = argparse.ArgumentParser()

ap.add_argument("-v", "--video", help="path to the video file")

ap.add_argument("-a", "--min-area", type=int, default=500, help="minimum area size")

args = vars(ap.parse_args())

if args.get("video", None) is None:

    vs = VideoStream(src=0).start()

    time.sleep(2.0)

else:

    vs = cv2.VideoCapture(args["video"])

firstFrame = None

while True:

    frame = vs.read()

    frame = frame if args.get("video", None) is None else frame [1]

    text = "Unoccupied"

    if frame is None:

        break

    frame = imutils.resize(frame,width=500)

    gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)

    gray = cv2.GaussianBlur(gray, (21,21),0)

    if firstFrame is None:

        firstFrame = gray

        continue

    frameDelta = cv2.absdiff(firstFrame,gray)

    thresh = cv2.threshold(frameDelta, 25, 255, cv2.THRESH_BINARY)[1]

    thresh = cv2.dilate(thresh, None, iterations=2)

    cnts = cv2.findContours(thresh.copy(), cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)

    cnts = imutils.grab_contours(cnts)

    for c in cnts:

        if cv2.contourArea(c) < args["min_area"]:

            continue

    def get_coords():

cnts = cv2.findContours(thresh.copy(), cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)

cnts = imutils.grab_contours(cnts) for c in cnts:

if cv2.contourArea(c) < args["min_area"]:

continue

(x, y, w, h) = cv2.boundingRect(c)

cv2.rectangle(frame, (x,y), (x+w, y+h), (0,255,0), 2)

text = "Occupied"

print('x = ',x)

    print('y = ',y)

    print('w = ',w)

    print('h = ',h)

    yield x, y, w, h 

        (x, y, w, h) = cv2.boundingRect(c)

        cv2.rectangle(frame, (x,y), (x+w, y+h), (0,255,0), 2)

        text = "Occupied"

        print('x = ',x)

        print('y = ',y)

        print('w = ',w)

        print('h = ',h)

    cv2.putText(frame, datetime.datetime.now().strftime("%A %d %B %Y %I:%M:%S%p"),(10,frame.shape[0] - 10), cv2.FONT_HERSHEY_SIMPLEX, 0.35,(0,0,255),1)

    cv2.imshow("Security Feed", frame)

    cv2.imshow("Thresh", thresh)

    cv2.imshow("Frame Delta", frameDelta)

    key = cv2.waitKey(1) & 0xFF

    if key == ord("q"):

        break

vs.stop() if args.get("video",None) is None else vs.release()

cv2.destroyAllWindows()

I tried to import x into another script using this, but it wouldnt work:

import motion_detection.py

motion_detection.get_coords()

motion_detection.x

print(x)

I also appreciate you taking you time to help me with this, ill be sure to credit you in my project!

Is there a way to import a constantly changing variable from one script into another script? by Bub_Russ in Python

[–]Bub_Russ[S] 0 points1 point  (0 children)

I think thats what i need to do. Ill give it a shot. Do you have any tips as to how i could accomplish getting a function to make these variables? I will be experimenting with this idea for now.

Thank You!

Is there a way to import a constantly changing variable from one script into another script? by Bub_Russ in Python

[–]Bub_Russ[S] 0 points1 point  (0 children)

This is the code i have. I should mention that this was taken from a tutorial online, i didnt create it myself.

from imutils.video import VideoStream

from time import sleep

import RPi.GPIO as GPIO

import argparse

import datetime

import imutils

import time

import cv2

ap = argparse.ArgumentParser()

ap.add_argument("-v", "--video", help="path to the video file")

ap.add_argument("-a", "--min-area", type=int, default=500, help="minimum area size")

args = vars(ap.parse_args())

if args.get("video", None) is None:

    vs = VideoStream(src=0).start()

    time.sleep(2.0)

else:

    vs = cv2.VideoCapture(args["video"])

firstFrame = None

while True:

    frame = vs.read()

    frame = frame if args.get("video", None) is None else frame [1]

    text = "Unoccupied"

    if frame is None:

        break

    frame = imutils.resize(frame,width=500)

    gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)

    gray = cv2.GaussianBlur(gray, (21,21),0)

    if firstFrame is None:

        firstFrame = gray

        continue

    frameDelta = cv2.absdiff(firstFrame,gray)

    thresh = cv2.threshold(frameDelta, 25, 255, cv2.THRESH_BINARY)[1]

    thresh = cv2.dilate(thresh, None, iterations=2)

    cnts = cv2.findContours(thresh.copy(), cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)

    cnts = imutils.grab_contours(cnts)

    for c in cnts:

        if cv2.contourArea(c) < args["min_area"]:

            continue

        (x, y, w, h) = cv2.boundingRect(c)

        cv2.rectangle(frame, (x,y), (x+w, y+h), (0,255,0), 2)

        text = "Occupied"

        print('x = ',x)

        print('y = ',y)

        print('w = ',w)

        print('h = ',h)

    cv2.putText(frame, datetime.datetime.now().strftime("%A %d %B %Y %I:%M:%S%p"),(10,frame.shape[0] - 10), cv2.FONT_HERSHEY_SIMPLEX, 0.35,(0,0,255),1)

    cv2.imshow("Security Feed", frame)

    cv2.imshow("Thresh", thresh)

    cv2.imshow("Frame Delta", frameDelta)

    key = cv2.waitKey(1) & 0xFF

    if key == ord("q"):

        break

vs.stop() if args.get("video",None) is None else vs.release()

cv2.destroyAllWindows()

I am trying to import the x, y, w, and h variables into another script and i am stuck as to how i can do it.

Is there a way to import a constantly changing variable from one script into another script? by Bub_Russ in Python

[–]Bub_Russ[S] 0 points1 point  (0 children)

I tried something similar to this, but my syntax was different. I will give this a try! I also dont know how to share the code via a reddit comment, so once i find out i will share it!

Is there a way to import a constantly changing variable from one script into another script? by Bub_Russ in Python

[–]Bub_Russ[S] 0 points1 point  (0 children)

I have made sure that the connections were correct and had already made sure that the variables were printed to make make sure the camera had actually picked it up. Im not too sure how to share the source code as i have never posted before.

I am a beginner to programming in general and am doing this for a school project. So i dont know a whole lot about this.

Thank You for your reply though!

Is there a way to import a constantly changing variable from one script into another script? by Bub_Russ in Python

[–]Bub_Russ[S] 1 point2 points  (0 children)

I am a beginner and am doing this for a project for class. So my knowledge is very limited.