Esempio n. 1
0
    def __init__(self):
        self.h = 1
        self.k = 1
        self.x = 0
        self.taleList = []
        # Figuras basicas

        gpu_head_quad = es.toGPUShape(
            bs.createTextureQuad('caeza.png'), GL_REPEAT, GL_NEAREST)  # morado


        # Creamos la cabeza

        head = sg.SceneGraphNode('head')
        head.transform = tr.scale(1/self.N, 1/self.N, 1)
        head.childs += [gpu_head_quad]

        # Armamos la serpiente

        ekans = sg.SceneGraphNode ('ekans')
        self.transform_ekans = sg.SceneGraphNode('ekansTR')
        self.transform_ekans.childs += [head]


        self.posicion_x = 1/self.N
        self.posicion_y = 1/self.N
        self.model = self.transform_ekans
Esempio n. 2
0
    def __init__(self):
        gpu_limit_quad = es.toGPUShape(bs.createColorQuad(0, 0, 0))  # negro

        # Creamos el limite

        limit = sg.SceneGraphNode('grasp')
        limit.transform = tr.scale(1 / self.N, 1 / self.N, 1)
        limit.childs += [gpu_limit_quad]

        limit_tr = sg.SceneGraphNode("limitTR")
        limit_tr.childs += [limit]

        self.model = limit_tr
Esempio n. 3
0
    def __init__(self):
        gpu_defeat_quad = es.toGPUShape(bs.createTextureQuad('gameover.png'),
                                        GL_REPEAT, GL_NEAREST)

        # Creamos el cartel

        defeat = sg.SceneGraphNode('grasp')
        defeat.transform = tr.scale(10 / self.N, 10 / self.N, 1)
        defeat.childs += [gpu_defeat_quad]

        defeat_tr = sg.SceneGraphNode("limitTR")
        defeat_tr.childs += [defeat]

        self.model = defeat_tr
Esempio n. 4
0
    def __init__(self):
        gpu_apple = es.toGPUShape(bs.createColorQuad(1, 0, 0))  # rojo

        # Creamos las manzana

        apple = sg.SceneGraphNode('apple')
        apple.transform = tr.scale(1/self.N, 1/self.N, 1)
        apple.childs += [gpu_apple]

        apple_tr = sg.SceneGraphNode("appleTR")
        apple_tr.childs += [apple]

        self.pos_y = random.choice(np.arange(-1 + 1/self.N, 1 - 1/self.N, 1/self.N))
        self.pos_x = random.choice(np.arange(-1 + 1/self.N, 1 - 1/self.N, 1/self.N))
        self.model = apple_tr
Esempio n. 5
0
    def __init__(self, p_x, p_y):
        self.o = 1
        gpu_tale_quad = es.toGPUShape(
            bs.createTextureQuad('cuerpo.new.png'), GL_REPEAT, GL_NEAREST)  # celeste

        # Creamos la cola
        tale = sg.SceneGraphNode('tale')
        tale.transform = tr.scale(1 / self.N, 1 / self.N, 1)
        tale.childs += [gpu_tale_quad]

        tale_tr = sg.SceneGraphNode("taleTR")
        tale_tr.childs += [tale]

        self.p_x = p_x
        self.p_y = p_y
        self.model = tale_tr