def make_obj19(off_x, off_y): obj19 = cosmetic_ball([ int(p.x + fraction(461, 2) + fraction(-331, 2)) + int(off_x), +int(p.y + 43 + -43), int(off_y) ], fraction(201, 2)) obj19.color = Color('white') obj19.group = 19 obj19_image = pygame.image.load('./py-fizz-images/obj19.png') image_bindings.append([obj19, obj19_image]) user_shapes.append(obj19) return obj19
def make_obj10(off_x, off_y): obj10 = cosmetic_ball([ int(p.x + fraction(175, 2) + fraction(-331, 2)) + int(off_x), +int(p.y + 66 + -43), int(off_y) ], fraction(5, 2)) obj10.color = Color('white') obj10.group = 10 obj10_image = pygame.image.load('./py-fizz-images/obj10.png') image_bindings.append([obj10, obj10_image]) user_shapes.append(obj10) return obj10
def make_obj8(off_x, off_y): obj8 = cosmetic_ball([ int(p.x + 65 + fraction(-331, 2)) + int(off_x), +int(p.y + fraction(87, 2) + -43), int(off_y) ], fraction(5, 2)) obj8.color = Color('white') obj8.group = 8 obj8_image = pygame.image.load('./py-fizz-images/obj8.png') image_bindings.append([obj8, obj8_image]) user_shapes.append(obj8) return obj8
def make_obj4(off_x, off_y): obj4 = box([ int(p.x + 65 + fraction(-331, 2) - fraction(41, 2)) + int(off_x), int(p.y + fraction(41, 2) + -43 - fraction(41, 2)) + int(off_y) ], 41, 41) obj4.color = Color('white') obj4.group = 4 obj4_image = pygame.image.load('./py-fizz-images/obj4.png') image_bindings.append([obj4, obj4_image]) user_shapes.append(obj4) obj4.hit([0, 0], obj4.position) obj4.hit([-2010000, 0], obj4.position) return obj4
def make_obj7(off_x, off_y): obj7 = ball([ int(p.x + 110 + fraction(-331, 2)) + int(off_x), +int(p.y + 66 + -43), int(off_y) ], 20) obj7.color = Color('white') obj7.group = 7 obj7_image = pygame.image.load('./py-fizz-images/obj7.png') image_bindings.append([obj7, obj7_image]) user_shapes.append(obj7) obj7.elasticity = 1.0 * 0 motor(obj7, 1) obj7.hit([-2010000, 0], obj7.position) return obj7
from hy.core.language import fraction None True False 42 42 42 42 3.14 (1+2j) 3j fraction(2, 3) """Hello world!""" """Hello world!""" """Hello world!""" """ ------- < Lisp! > ------- \\ \\ \\_\\_ _/_/ \\ \\__/ (oo)\\_______ (__)\\ )\\/\\ ||----w | || || """ """ ------- < Lisp! > ------- \\ \\ \\_\\_ _/_/
def make_obj17(off_x, off_y): obj17 = box( [int(260 - fraction(101, 2)) + int(off_x), int(260 - 25) + int(off_y)], 101, 50) obj17.color = Color('white') obj17.group = 17 obj17_image = pygame.image.load('./py-fizz-images/obj17.png') image_bindings.append([obj17, obj17_image]) user_shapes.append(obj17) def on_click_17(keys): global click_handled f = obj17 if not f or not f.body: return False _hy_anon_var_5 = None else: _hy_anon_var_5 = None p = f.body.position if mouse_clicked() and obj17.inside( mouse_point()) and obj17.active and click_handled == 0: def make_obj4(off_x, off_y): obj4 = box([ int(p.x + 65 + fraction(-331, 2) - fraction(41, 2)) + int(off_x), int(p.y + fraction(41, 2) + -43 - fraction(41, 2)) + int(off_y) ], 41, 41) obj4.color = Color('white') obj4.group = 4 obj4_image = pygame.image.load('./py-fizz-images/obj4.png') image_bindings.append([obj4, obj4_image]) user_shapes.append(obj4) obj4.hit([0, 0], obj4.position) obj4.hit([-2010000, 0], obj4.position) return obj4 obj4 = make_obj4(0, 0) def make_obj8(off_x, off_y): obj8 = cosmetic_ball([ int(p.x + 65 + fraction(-331, 2)) + int(off_x), +int(p.y + fraction(87, 2) + -43), int(off_y) ], fraction(5, 2)) obj8.color = Color('white') obj8.group = 8 obj8_image = pygame.image.load('./py-fizz-images/obj8.png') image_bindings.append([obj8, obj8_image]) user_shapes.append(obj8) return obj8 obj8 = make_obj8(0, 0) def make_obj5(off_x, off_y): obj5 = ball([ int(p.x + 20 + fraction(-331, 2)) + int(off_x), +int(p.y + 66 + -43), int(off_y) ], 20) obj5.color = Color('white') obj5.group = 5 obj5_image = pygame.image.load('./py-fizz-images/obj5.png') image_bindings.append([obj5, obj5_image]) user_shapes.append(obj5) obj5.elasticity = 1.0 * 0 motor(obj5, 1) obj5.hit([-2010000, 0], obj5.position) return obj5 obj5 = make_obj5(0, 0) def make_obj9(off_x, off_y): obj9 = cosmetic_ball([ int(p.x + fraction(85, 2) + fraction(-331, 2)) + int(off_x), +int(p.y + 66 + -43), int(off_y) ], fraction(5, 2)) obj9.color = Color('white') obj9.group = 9 obj9_image = pygame.image.load('./py-fizz-images/obj9.png') image_bindings.append([obj9, obj9_image]) user_shapes.append(obj9) return obj9 obj9 = make_obj9(0, 0) def make_obj6(off_x, off_y): obj6 = ball([ int(p.x + 65 + fraction(-331, 2)) + int(off_x), +int(p.y + 66 + -43), int(off_y) ], 20) obj6.color = Color('white') obj6.group = 6 obj6_image = pygame.image.load('./py-fizz-images/obj6.png') image_bindings.append([obj6, obj6_image]) user_shapes.append(obj6) obj6.elasticity = 1.0 * 0 motor(obj6, 1) obj6.hit([-2010000, 0], obj6.position) return obj6 obj6 = make_obj6(0, 0) def make_obj10(off_x, off_y): obj10 = cosmetic_ball([ int(p.x + fraction(175, 2) + fraction(-331, 2)) + int(off_x), +int(p.y + 66 + -43), int(off_y) ], fraction(5, 2)) obj10.color = Color('white') obj10.group = 10 obj10_image = pygame.image.load('./py-fizz-images/obj10.png') image_bindings.append([obj10, obj10_image]) user_shapes.append(obj10) return obj10 obj10 = make_obj10(0, 0) def make_obj7(off_x, off_y): obj7 = ball([ int(p.x + 110 + fraction(-331, 2)) + int(off_x), +int(p.y + 66 + -43), int(off_y) ], 20) obj7.color = Color('white') obj7.group = 7 obj7_image = pygame.image.load('./py-fizz-images/obj7.png') image_bindings.append([obj7, obj7_image]) user_shapes.append(obj7) obj7.elasticity = 1.0 * 0 motor(obj7, 1) obj7.hit([-2010000, 0], obj7.position) return obj7 obj7 = make_obj7(0, 0) def make_obj19(off_x, off_y): obj19 = cosmetic_ball([ int(p.x + fraction(461, 2) + fraction(-331, 2)) + int(off_x), +int(p.y + 43 + -43), int(off_y) ], fraction(201, 2)) obj19.color = Color('white') obj19.group = 19 obj19_image = pygame.image.load('./py-fizz-images/obj19.png') image_bindings.append([obj19, obj19_image]) user_shapes.append(obj19) return obj19 obj19 = make_obj19(0, 0) p = pin(obj5.body.position, obj5, obj6.body.position, obj6) connected_shapes.append([obj5, obj6, p]) p = pin(obj5.body.position, obj5, obj4.body.position, obj4) connected_shapes.append([obj5, obj4, p]) p = pin(obj6.body.position, obj6, obj7.body.position, obj7) connected_shapes.append([obj6, obj7, p]) p = pin(obj6.body.position, obj6, obj4.body.position, obj4) connected_shapes.append([obj6, obj4, p]) p = pin(obj7.body.position, obj7, obj4.body.position, obj4) connected_shapes.append([obj7, obj4, p]) click_handled = 2 return True _hy_anon_var_14 = None else: _hy_anon_var_14 = None return _hy_anon_var_14 add_observer(on_click_17) return obj17
from hy.core.language import fraction import math import pymunk from pyphysicssandbox import * import pygame from pyphysicssandbox import Vec2d w = 505 h = 373 user_shapes = [] image_bindings = [] pivots = [] connected_shapes = [] window('Most Awesome Thing Ever', 505, 373) obj139 = static_box([int(fraction(505, 2) - fraction(505, 2)), int(368 - 5)], 505, 10) obj139.color = Color('white') obj139.group = 139 obj139_image = pygame.image.load( '/Users/thoughtstem/Dev/Python/py-fizzery/obj139.png') image_bindings.append([obj139, obj139_image]) user_shapes.append(obj139) obj141 = static_box( [int(500 - 5), int(fraction(373, 2) - fraction(353, 2))], 10, 353) obj141.color = Color('white') obj141.group = 141 obj141_image = pygame.image.load( '/Users/thoughtstem/Dev/Python/py-fizzery/obj141.png') image_bindings.append([obj141, obj141_image]) user_shapes.append(obj141) obj137 = cosmetic_ball( [int(fraction(505, 2)), int(fraction(373, 2))], fraction(485, 2))