示例#1
0
def setup():
    global e, model, obs

    p.size(800, 600)
    e = Env(width, height)
    model = DQN.load("ball_blast_dqn_25000")
    obs = e.reset()
示例#2
0
def setup():
    global point_a
    global point_b
    size(600, 360)
    background(255)
    point_a = Vector(100, 300)
    point_b = Vector(400, 100)
示例#3
0
def setup():
    size(400, 300)
    global fountain
    global field
    field_strength = 4
    field = FlowField(field_strength)
    fountain = ParticleSystem()
示例#4
0
def setup():
    size(400, 300)
    global brum
    global field
    field_strength = 4
    brum = Vehicle()
    field = FlowField(field_strength)
示例#5
0
def setup():
    size(800, 600)
    global vehicles
    global path
    vehicles = ParticleSystem()
    path = Path()
    path.populate()
示例#6
0
def setup():
    ratio = 1.8
    pf.size(1280 / ratio, 720 / ratio)
    pf.text_font(font)
    pf.text_size(50)
    pf.no_stroke()
    pf.no_loop()
示例#7
0
def setup():
    size(640, 360)
    no_stroke()
    background(0)
    global perlx
    global perly
    perlx = random_uniform(1000)
    perly = 0
def setup():
    global Man, wordDisplay, newLetter, Game
    print(word)
    p5.size(400, 500)
    Man = HangmanDrawing(width / 4, 200, width / 2, 200, 0)
    Game = HangmanGame(word)
    Game.revealed = "*" * len(word)
    wordDisplay = HangmanWordDisplay(height / 2 + 20, width)
    newLetter = " "
示例#9
0
def setup():
    global img_L, t1
    ratio = 1.2
    pf.size(win_w / ratio, win_h / ratio)
    pf.text_font(font)
    # pf.no_stroke()
    # pf.no_loop()
    t1 = time.time()
    pr.enable()
def setup():
    global LeftPlanet,RightPlanet
    p5.scale(1,-1)
    p5.size(1500,700)
    p5.translate(0,-height)

    LeftPlanet=Planet(0,height/2,1,[10,0],25,trail=1)
    LeftPlanet.pos.x+=LeftPlanet.r
    RightPlanet=Planet(width,height/2,1,[-10,0],25,trail=1)
    RightPlanet.pos.x-=RightPlanet.r
示例#11
0
def setup():
    # toplar değişkenini değiştirabilmek için global anahtar kelimesi kullanıldı
    global toplar
    # widthxheight ebatlarında bir pencere oluşturuldu
    p5.size(width, height)

    # toplar dizi değişkeninin içine 20 adet Top objesi yerleştiriliyor
    for _ in range(20):
        # Konum, Hız ve çap değerleri rastgele seçiliyor
        toplar.append(
            Top(randint(5, width - 5), randint(5, height - 5), randint(-7, 7),
                randint(-7, 7), randint(5, 10)))
示例#12
0
def setup():
    # isimler adlı değikeni düzenleyebilmek için global
    global isimler

    # Pencere boyutu ayarla
    p5.size(1920, 1080)
    # isimler listesini al
    isimler = isimleri_al()

    # çizgi rengi belirle
    p5.stroke(p5.Color(41, 255, 41, 41))
    # çizgi kalınlığı belirle
    p5.stroke_weight(3)
示例#13
0
    def __init__(self, w=900, h=600):
        # prediction
        self.brain = Brain.Deep_Learning()
        self.brain.load_from_backup(
            "/Users/maxime/Downloads/lang_pong_py/saved/deep_learning_2019-03-11 18:54:52.634303_.h5"
        )
        self.brain.load_data()
        self.brain.setup_model()

        if isinstance(self.brain, Brain.Neural_Network):
            self.batch_size = 70
            self.epochs = 150
        elif isinstance(self.brain, Brain.Deep_Learning):
            self.batch_size = 50
            self.epochs = 40
        else:
            self.batch_size = 0
            self.epochs = 0

        # global const
        self.width = w
        self.height = h
        self.offset = 5
        p5.size(self.width, self.height)

        self.should_serve = True
        self.paused = True
        self.serve_user = True
        self.user_interaction = 0

        self.gathering_DL_data = False
        self.trainings = []

        self.draw_prediction = False
        self.last_prediction = None

        self.speed_factor = 1.4
        self.block_height = self.height / 5.0
        self.block_width = self.width / 50.0
        self.ball_radius = self.height / 40.0
        self.speed = self.block_height * 0.09

        self.user = Block(0, 0)
        self.machine = Block(self.width - self.block_width, 0)
        self.ball = Ball(0, 0)

        self.serve()
        self.printScore()

        self.frame_rate = 0
示例#14
0
def setup():
    if verbose:
        print(f"Setting up.")
    if fn_img:
        furthest_element = img.height
        size(img.width, img.height)
    else:
        furthest_element = df.location.str.get('y').max()
        furthest_element_height = df[df.location.str.get(
            'y') == furthest_element].dimensions.str.get('height').tolist()[0]
        length = int(furthest_element_height + furthest_element + 10)
        size(375, length)
    if verbose:
        print(f"Length of canvas is {furthest_element} px.")
    no_loop()
示例#15
0
def setup():
    size(640, 480)
    global fountains
    global gravity
    global wind
    global repeller
    repeller = Repeller(Vector(width / 2, height - 100), 40)

    wind = Wind()
    ground = SurfaceGravity()
    gravity = ground.attract()

    initial_num_of_fountains = 2
    fountains = []
    for i in range(initial_num_of_fountains):
        fountains.append(ParticleSystem(i * 100, i * 100, i))
示例#16
0
def setup():
    global planet, moon
    p5.scale(1, -1)
    p5.size(1500, 700)
    p5.translate(0, -height)
    planet = Planet(width / 2, height / 2, 20, [0, 0], 500, trail=0)
    moon = Planet(width / 2,
                  planet.pos.y + planet.r + 50,
                  1, [0, 0],
                  10,
                  trail=1)

    #0,1,2,5,7,7.5,7.7,7.8,7.82

    min_orbit_vx = np.sqrt(
        ((G * planet.m) / (abs(moon.initpos.y - planet.initpos.y))))
    #moon.vel.x=min_orbit_vx

    print(min_orbit_vx)
示例#17
0
def setup():
    # global simulation
    # this happens just once
    size(simulation.width, simulation.height)  # instead of create_canvas
def setup():
    p5.size(2 * res, res)
    p5.background(240, 238, 225)
示例#19
0
def setup():
    size(WIDTH, HEIGHT)
示例#20
0
def setup():
    p.size(600, 600)
    p.rect_mode('CENTER')
    p.color_mode('HSB')
示例#21
0
def setup():
    p.size(width, height)
    p.no_fill()
示例#22
0
def setup():
    global walker
    p5.size(400, 400)
    walker = Walker(width / 2, height / 2)
示例#23
0
def setup():
    p.size(600, 600)
示例#24
0
def setup():
    size(498,298)
    global vehicles
    vehicles = ParticleSystem()
示例#25
0
 def setup(self):
     p5.size(self.window_width, self.window_height)
     p5.background(0)
     p5.no_loop()
示例#26
0
def setup():
    p.rect_mode('CENTER')
    p.size(width, height)
示例#27
0
def setup():
    global height, width
    p.size(width, height)  # size must be the first statement
示例#28
0
def setup():
    p5.size(16 * 40, 16 * 40)
示例#29
0
def setup():
    #once call at RUN
    #set-up: canvas size
    size(width, heigth)
示例#30
0
def setup():
    # Pencereyi tanımlanan boyutta oluştur
    p5.size(w, h)