Example #1
0
import meet 
cells =[]

x = 0
while x <10:
	a = {"radius":13 , "x":meet.get_random_x() , "y":meet.get_random_y() , "dx": 0.11 , "dy": 1 , "color": "black"}
	c= meet.create_cell(a)
	cells.append(c)
	x+=1


a = {"radius":13 , "x":0 , "y":0 , "dx": 0, "dy": 0 , "color": "black"}
user= meet.create_cell(a)
cells.append(user)
while True : 
	meet.move_cells(cells)
	for cell in cells:
		x=cell.xcor()
		y=cell.ycor()
		h= meet.get_screen_height()
		w = meet.get_screen_width()
		if (x>w or x<-w):
			cell.set_dx(-cell.get_dx())
		if (y>h or y<-h):
			cell.set_dy(-cell.get_dy())
	dx,dy = meet.get_user_direction(user)
	user.set_dx(dx)
	user.set_dy(dy)
Example #2
0
import meet
import random
import time
import turtle

colors=["blue", "red", "pale green", "purple", "yellow", "brown", "maroon", "grey", "gold", "pink"]
cells=[]
user_cell= {"radius": 20, "x": 50, "y": -50, "dy": 1, "dx": 2, "color": "black"}
user_cell1= meet.create_cell(user_cell)
cells.append(user_cell1)
z=0
while(z<20):
	ball1= {"radius": random.randint(10,30), "x":random.randint(-50,100), "y":random.randint(30,100), "dy":random.random(), "dx": random.random(), "color": colors[random.randint(0, len(colors)-1)]}
	circle1= meet.create_cell(ball1)
	cells.append(circle1)
	z+=1
playing=True

def borders(cells):
	for cell in cells:
		width = meet.get_screen_width()
		height = meet.get_screen_height()
		x = cell.xcor()
		y = cell.ycor()
		if (x > width):
			cell.set_dx(-cell.get_dx())
		if (x < -width):
			cell.set_dx(-cell.get_dx())
		if (y > height):
			cell.set_dy(-cell.get_dy())
		if (y < -height):
Example #3
0
    turtle.hideturtle()
    turtle.color("black")
    turtle.write(" "+str(x),align='center',font=('ariel',80,'bold'))
    turtle.speed("slowest")
    time.sleep(0.4)
    turtle.clear()
    x-=1





colors=["purple",'blue','green','pink','red','brown','grey','maroon']
cells=[]
balls1={'radius':11,'x':0,'y':0 , 'dx' : 0 , 'dy' : 0, 'color':'yellow'}
myCircle = meet.create_cell(balls1)
cells.append(myCircle)

#black circle
balls2={'radius':30,'x':random.randint(-275,275),'y':random.randint(-275,275),'dx':random.randint(-1,3),'dy':random.randint(-1,1),'color':'black'}
badCircle = meet.create_cell(balls2)
cells.append(badCircle)

num_cells=0
while num_cells<12:
        balls={'radius':random.randint(3,25) ,'x':random.randint(-280,280),'y':random.randint(-280,280) ,'dx':random.randint(-1,1),'dy':random.randint(-1,1),'color':random.choice(colors)}
        num_cells+=1
        circle = meet.create_cell(balls)
        cells.append(circle)

Example #4
0
import meet
import turtle

user_cell={'radius':15,'x':0,'y':0,'dx':0.1,'dy':0.2,'color':'red','shape':'circle'}
cell1={'radius':28,'x':-150,'y':-100,'dx':0.2,'dy':-0.10,'color':'orange','shape':'circle'}
cell2={'radius':25,'x':150,'y':-100,'dx':-0.2,'dy':-0.4,'color':'pink','shape':'circle'}
cell3={'radius':12,'x':100,'y':150,'dx':0.3,'dy':0.5,'color':'blue','shape':'circle'}
cell4={'radius':20,'x':120,'y':-130,'dx':0.8,'dy':0.9,'color':'green','shape':'circle'}
cell5={'radius':15,'x':170,'y':150,'dx':0.60,'dy':-0.5,'color':'yellow','shape':'circle'}

cells=[]
user_cell=meet.create_cell(user_cell)
cells.append(user_cell)
cell1=meet.create_cell(cell1)
cells.append(cell1)
cell2=meet.create_cell(cell2)
cells.append(cell2)
cell3=meet.create_cell(cell3)
cells.append(cell3)
cell4=meet.create_cell(cell4)
cells.append(cell4)
cell5=meet.create_cell(cell5)
cells.append(cell5)

def Edge(cells):
	for cell in cells:
		if cell.xcor() + cell.get_radius()>meet.get_screen_width():
			cell.set_dx(-cell.get_dx())
		if cell.xcor() + cell.get_radius()<-meet.get_screen_width():
			cell.set_dx(-cell.get_dx())
		if cell.ycor() + cell.get_radius()>meet.get_screen_height():
Example #5
0
import meet
from meet import *
import random
cells=[]
user_cell={"x":0,"y":0,"radius":10,"dy":0,"dx":0,"color":"black"}
user_cell=meet.create_cell(user_cell)
cells.append(user_cell)
colors=["red","blue","pink","purple","black","orange","green","gray","gold", "yellow"]
for x in range (20):
	cell={"x":get_random_x(),"y":get_random_y(),"radius":random.randint(10,20),"dy":random.uniform(-1.00,2.00),"dx":random.uniform(-1.00,2.00),"color":random.choice(colors)}
	z=create_cell(cell)
	cells.append(z)


def Edge(cells):
	x,y=meet.get_user_direction(user_cell)
	user_cell.set_dx(x)
	user_cell.set_dy(y)
	for cell in cells:
		w=meet.get_screen_width()
		h=meet.get_screen_height()
		x=cell.xcor()
		y=cell.ycor()

		if (cell.xcor()>w):
			cell.set_dx(-cell.get_dx())
	
		elif (cell.xcor()<-w):
			cell.set_dx(-cell.get_dx())
		if (cell.ycor()>h):	
			cell.set_dy(-cell.get_dy())
Example #6
0
import meet
import random
user_cell_dictionary={"radius":30,"x":6,"y":6,"dy":1,"dx":1,"color":"yellow"}

cells=[]


x=0
while x<24:
	x+=1
	ball3={"radius":random.randint(3,10),"x":meet.get_random_x(),"y":meet.get_random_y(),"dy":1,"dx":1}

	circle3 = meet.create_cell(ball3)
	cells.append(circle3)
	


user_cell=meet.create_cell(user_cell_dictionary)
cells.append(user_cell)





def Edge(cells):
	h=meet.get_screen_width() 
	w=meet.get_screen_height() 
	for cell in cells:
		if cell.xcor() + cell.get_radius() >= h:
			x=cell.get_dx()
			cell.set_dx(-x)
Example #7
0
import meet
import random 

num_cells=0
colors=["purple",'blue','green','pink']
cells=[]
balls1={'radius':25,'x':0,'y':-220 , 'dx' : 0 , 'dy' : 0, 'color':'yellow'}
circle1 = meet.create_cell(balls1)
cells.append(circle1)
square_size=90

while num_cells<15:
	balls={'radius':random.randint(0
,80) ,'x':random.randint(-200+square_size,200),'y':random.randint(-180
+square_size,180) ,'dx':random.uniform(-1,1),'dy':random.uniform(-1,1),'color':random.choice(colors)}

	num_cells+=1
	circle = meet.create_cell(balls)
	cells.append(circle)


def borders(cells):
	for cell in cells:		
		sw=meet.get_screen_width()
		sh=meet.get_screen_height()
		x=cell.xcor()
		y=cell.ycor()
		if (x > sw):	
			cell.set_dx(-cell.get_dx())
		if (y > sh):
			cell.set_dy(-cell.get_dy())
Example #8
0
cell1 = {'radius':18,'x':5, 'y':150, 'dx':0.8, 'dy':0.8, 'color':'blue', 'shape':'square'}
cell2 = {'radius':10,'x':10, 'y':10, 'dx':-0.8, 'dy':0.8, 'color':'green', 'shape':'square'}
cell3 = {'radius':25,'x':7, 'y':-150, 'dx':0.8, 'dy':0.8, 'color':'red', 'shape':'square'}
cell4 = {'radius':14,'x':100, 'y':-200, 'dx':-0.8, 'dy':0.8, 'color':'purple', 'shape':'square'}
cell5 = {'radius':25,'x':-100, 'y':200, 'dx':0.8, 'dy':0.8, 'color':'green', 'shape':'square'}
cell6 = {'radius':10,'x':150, 'y':150, 'dx':0.8, 'dy':0.8, 'color':'yellow', 'shape':'square'}
cell7 = {'radius':10,'x':125, 'y':-100, 'dx':-0.8, 'dy':0.8, 'color':'orange', 'shape':'square'}
cell8 = {'radius':25,'x':150, 'y':100, 'dx':0.8, 'dy':-0.8, 'color':'yellow', 'shape':'square'}
cell9 = {'radius':16,'x':-125, 'y':50, 'dx':0.8, 'dy':-0.8, 'color':'green', 'shape':'square'}
cell10 = {'radius':14,'x':-45, 'y':300, 'dx':0.8, 'dy':0.8, 'color':'blue', 'shape':'square'}
cell11 = {'radius':14,'x':-250, 'y':50, 'dx':-0.8, 'dy':-0.8, 'color':'pink', 'shape':'square'}
cell12 = {'radius':16,'x':-200, 'y':120, 'dx':-0.8, 'dy':0.8, 'color':'pink', 'shape':'square'}


cells=[]
user_cell = meet.create_cell(user_cell)
cells.append(user_cell)

cell = meet.create_cell(cell1)
cells.append(cell)
cell = meet.create_cell(cell2)
cells.append(cell)
cell = meet.create_cell(cell3)
cells.append(cell)
cell = meet.create_cell(cell4)
cells.append(cell)
cell = meet.create_cell(cell5)
cells.append(cell)
cell = meet.create_cell(cell6)
cells.append(cell)
cell = meet.create_cell(cell7)
Example #9
0
import meet
import random

PLAYING = True

cells=[]

user_cell={'radius':10, 'x':0, 'y':0, 'dx':0, 'dy':0, 'color': 'blue'}

for i in range(0,20):

	cells1= {'radius':meet.random.randint(2,20), 'x':meet.get_random_x(), 'y':meet.get_random_y(), 'dx':random.randint(-30,30)/100.0, 'dy':random.randint(-30,30)/100.0}
	cells1=meet.create_cell(cells1)
	cells.append(cells1)

user_cell=meet.create_cell(user_cell)
cells.append(user_cell)

def border(cells):
	for cell in cells:
		if cell.ycor() > meet.get_screen_height() or cell.ycor() < -meet.get_screen_height():
			cell.set_dy(-cell.get_dy()*1.01)
		if cell.xcor() > meet.get_screen_width() or cell.xcor() < -meet.get_screen_width():
			cell.set_dx(-cell.get_dx()*1.01)

def collision(cells):
	global user_cell, PLAYING
	for cell in cells:
		
		for boy in cells:
Example #10
0
food1 = {'radius': 5, 'x':2, 'y':5, 'dx': 0, 'dy':0,'color':'yellow'}
food2 = {'radius': 5, 'x':50, 'y':12, 'dx': 0, 'dy':0,'color':'green'}
food3 = {'radius': 5, 'x':60, 'y':12, 'dx': 0, 'dy':0,'color':'blue'}
food4 = {'radius': 5, 'x':70, 'y':12, 'dx': 0, 'dy':0,'color':'black'}
food5 = {'radius': 5, 'x':80, 'y':12, 'dx': 0, 'dy':0,'color':'green'}
food6 = {'radius': 5, 'x':90, 'y':12, 'dx': 0, 'dy':0,'color':'green'}


cells = []
foods = []

running = True
food_eaten = False

user_cell = meet.create_cell(user_cell)
cells.append(user_cell)

cell = meet.create_cell(cell1)
cells.append(cell)
cell = meet.create_cell(cell2)
cells.append(cell)

cell = meet.create_cell(cell1)
cells.append(cell)
cell = meet.create_cell(cell2)
cells.append(cell)
cell = meet.create_cell(cell1)
cells.append(cell)
cell = meet.create_cell(cell2)
cells.append(cell)
Example #11
0
import meet

import random
cells=[]
cells_nums=0
colors=["yellow","blue","red","green","purple","pink","orange"]
while cells_nums<30:
	balls={'radius':random.randint(0,30),'x':random.randint(-200,100),'y':random.randint(-200,100),'dx':random.randint(-2,2),'dy':random.randint(-2,2),'color':random.choice(colors)}


	cells_nums+=1
	circle=meet.create_cell(balls)
	cells.append(circle)

user_cell = {'radius':20,'x':500, 'y':500, 'dx':0.1, 'dy':0.1, 'color':'black', 'shape':'circle'}
#cell1 = {'radius':18,'x':5, 'y':150, 'dx':1, 'dy':1, 'color':'blue', 'shape':'square'}
#cell2 = {'radius':10,'x':10, 'y':10, 'dx':-2, 'dy':-2, 'color':'green', 'shape':'square'}
#cell3 = {'radius':15,'x':7, 'y':-150, 'dx':8, 'dy':8, 'color':'red', 'shape':'square'}
#cell4 = {'radius':14,'x':100, 'y':-200, 'dx':-0.6, 'dy':-0.6, 'color':'purple', 'shape':'square'}
#cell5 = {'radius':25,'x':-100, 'y':200, 'dx':0.5, 'dy':0.5, 'color':'black', 'shape':'square'}
#cell6 = {'radius':5,'x':150, 'y':-150, 'dx':0.3, 'dy':-0.3, 'color':'black', 'shape':'square'}
#cell7 = {'radius':5,'x':125, 'y':-100, 'dx':-0.4, 'dy':0.4, 'color':'orange', 'shape':'square'}
#cell8 = {'radius':5,'x':-150, 'y':100, 'dx':0.2, 'dy':-0.2, 'color':'yellow', 'shape':'square'}
#cell9 = {'radius':5,'x':-125, 'y':50, 'dx':0.2, 'dy':0.2, 'color':'pink', 'shape':'square'}

#cells=[]
user_cell = meet.create_cell(user_cell)
cells.append(user_cell)

#cell = meet.create_cell(cell1)
#cells.append(cell)