Пример #1
0
 def f(args):
     model = props[1]
     x = args[0]
     y = args[1]
     a = Sprite(model = model)
     a.addComponent (Collider (flag = vars.flags.platform, mask = 0, tag = 0, shape = sh.Rect(width=vars.tileSize, height=vars.tileSize)))
     a.pos = [x * vars.tileSize, y * vars.tileSize, 0]
     a.addComponent (Info(piece = props[2]))
     b = Entity()
     b.pos = [2, -0.5, 0]
     b.addComponent (Collider (
         flag=vars.flags.foe,
         mask=vars.flags.player,
         tag = vars.tags.brick_sensor,
         shape = sh.Rect(width = vars.tileSize-4, height = 1.0)
     ))
     a.add(b)
     return a    
Пример #2
0
def makeBrick(model: str, x: float, y: float):
    a = Sprite(model=model)
    a.addComponent(
        compo.Collider(flag=vars.flags.platform,
                       mask=0,
                       tag=0,
                       shape=sh.Rect(width=vars.tileSize,
                                     height=vars.tileSize)))
    a.pos = [x * vars.tileSize, y * vars.tileSize]

    b = Entity()
    b.pos = [2, -0.5, 0]
    b.addComponent(
        compo.Collider(flag=vars.flags.foe,
                       mask=vars.flags.player,
                       tag=vars.tags.brick_sensor,
                       shape=sh.Rect(width=vars.tileSize - 4, height=1.0)))
    a.add(b)
    return a