Esempio n. 1
0
import cloud
import world
import ccircle
import random
import ball
import sun
window = ccircle.Window("Lab 1", 800, 800)
my_world = world.World("blah")

y_change = 0
for i in range(1):
    x = random.randint(0, 800)
    y = random.randint(0, 150)
    size = random.randint(25, 100)
    my_world.add(cloud.Cloud(x, y, size))
    my_world.add(ball.Ball(100, 100 - y_change, 3, 4))
    y_change += 3

while window.isOpen():
    window.clear(0.1, 0.1, 0.1)
    my_world.draw(window)
    my_world.update()
    window.update()
Esempio n. 2
0
import ccircle
import random

window = ccircle.Window("Let's just get it working!")

bigger = True
wutwut = True
size = 50
color = 50
dotY = [
    0, -100, -240, -150, -70, -90, -210, -110, -40, -50, -69, -508, -57, -954,
    -195
]

dotX = [
    593, 105, 729, 345, 645, 893, 294, 169, 671, 716, 201, 801, 395, 487, 58
]
while window.isOpen():
    length, height = window.getSize()
    window.clear(0.01 * color, 0.01 * color, 0.02 * color)
    mouseX, mouseY = window.getMousePos()
    window.hideMouse()
    window.drawCircle(mouseX, mouseY, 100, 0.5, 1, 0.5)
    if ccircle.isMouseDown('left') == True:
        window.drawCircle(mouseX, mouseY + 30, size / 1.2, 0, 0, 0)
    else:
        window.drawCircle(mouseX, mouseY + 20, size, 0, 0, 0)
        window.drawCircle(mouseX, mouseY, size, 0.5, 1, 0.5)
    window.drawCircle(mouseX - 40, mouseY - 20, 16, 1, 1, 1)
    window.drawCircle(mouseX + 40, mouseY - 20, 16, 1, 1, 1)
    window.drawCircle(mouseX - 40, mouseY - 20, size / 5 + 2, 0, 0, 0)
Esempio n. 3
0
    def respond(self, status, data=None):
        try:
            response = {'status': status}
            if data:
                response['data'] = data
                util.log('{}  <-- {} {}'.format(self.client_address[0], status,
                                                data))
            else:
                util.log('{}  <-- {}'.format(self.client_address[0], status))
            self.request.sendall(bytes(json.dumps(response), 'utf-8'))
        except Exception as e:
            util.log('!! {}  <--  < {} >'.format(self.client_address[0], e))


window = ccircle.Window('Scenario 4 Server', 1024, 768)
if not LOCAL:
    window.toggleMaximized()

HOST = config.SERVER_HOST if not LOCAL else 'localhost'
PORT = config.SERVER_PORT

util.log('>> server started on {}:{} <<'.format(HOST, PORT))
server = socketserver.TCPServer((HOST, PORT), GameClientHandler)
server.state = game.State(window.getSize())
server.handler = game.MessageHandler(server.state)
server.timeout = 1.0 / 30.0

time_last = time.perf_counter()
while window.isOpen():
    window.clear(0.1, 0.1, 0.1)
Esempio n. 4
0
import ccircle
from math import *
window = ccircle.Window()
window.hideMouse()
the_answer_to_life_the_universe_and_everything = floor(42)

points = []
color = 'blue'
size = 4
cR = 0.1
cG = 0.5
cB = 1.0
while window.isOpen():
    window.clear(0.2, 0.2, 0.2)
    mX, mY = window.getMousePos()
    if color == 'blue':
        cR = 0.1
        cG = 0.5
        cB = 1.0
    elif color == 'green':
        cR = 0.1
        cG = 0.5
        cB = 0.1
    elif color == 'yellow':
        cR = 1.0
        cG = 1.0
        cB = 0.0
    elif color == 'red':
        cR = 1.0
        cG = 0.0
        cB = 0.0
Esempio n. 5
0
rent 25 45 70   

[ or ] costs 60
rent roll * 5

# gives 10 * random.randint(-3, 4)

+ costs 50
rent 20 * number of railroads

F gives does none

J skips your turn for 3 rounds
'''

window = ccircle.Window("TOWER DEFENSE!")

towers1 = [
    0,
    0,
    0,
    0,
    0,
]
towers2 = [
    0,
    0,
    0,
    0,
    0,
]