Beispiel #1
0
def fireHitsFoe(foe: example.Wrap1, fire: example.Wrap1, x, y):
    example.remove(fire.id)
    foe.setState ('dead2', {})
    s = Script()
    s.addAction (MoveAccelerated(v0=[50 if fire.x < foe.x else -50, 150], a=[0,vars.gravity], yStop = -32, id=foe.id))
    s.addAction (RemoveEntity (id=foe.id))
    example.play(s)
Beispiel #2
0
def onstart_scummbar():
    run_background_script('scummbar_pirate1', 1, 4, 1, 4)
    run_background_script('scummbar_pirate2', 1, 4, 1, 4)
    run_background_script('scummbar_mancomb', 1, 4, 0, 0)    
    run_background_script("scummbar_pirate3", 1, 4, 0.5, 0.5)
    run_background_script("scummbar_pirate4", 1, 4, 0, 0)
    run_background_script("scummbar_pirate5", 1, 4, 1, 2)
    run_background_script("scummbar_pirate7", 1, 4, 1, 2)
    run_background_script("scummbar_pirate8", 1, 4, 0, 0)
    run_background_script("scummbar_pirate9", 1, 4, 0, 0)
    run_background_script("scummbar_estevan", 1, 4, 0, 0)
    run_background_script("scummbar_loom", 1, 4, 0, 0)
    # play the cook script
    if eng.previous_room != 'kitchen':
        s = Script (id = '_cook', loop= 0)
        s.addAction (Delay (sec = 10))
        s.addAction (RunScript ( toggleDoor('scummbar_door_kitchen', True)() ))
        s.addAction (AddEntity (buildItem (id = 'cook'), 'walkarea'))
        s.addAction (Walk (tag ='cook', pos = [125, 17]))
        s.addAction (Turn (tag = 'cook', dir='n'))
        s.addAction (Delay (sec = 10))
        s.addAction (Walk (tag = 'cook', pos = [589, 14]))
        s.addAction (RemoveEntity (tag='cook'))
        s.addAction (RunScript ( toggleDoor('scummbar_door_kitchen', False)() ))
        example.play(s)
Beispiel #3
0
def m3(x: float, y: float):
    a = Sprite('score100', pos=[x * vars.tileSize, (y + 1) * vars.tileSize, 0])
    main = example.get('main')
    id = main.add(a)
    s = Script()
    s.addAction(Move(speed=100, by=[0, 64], id=id))
    s.addAction(RemoveEntity(id=id))
    example.play(s)
Beispiel #4
0
def m2(x: float, y: float):
    print ('x='+ str(x))
    def score():
        m3(x, y+1)
    a = Sprite ('flyingcoin', pos=[x * vars.tileSize, (y+1)*vars.tileSize, 0])
    main = example.get('main')
    id = main.add(a)
    s = Script()
    s.addAction(MoveAccelerated(v0 = [0, 100], a = [0, -100], yStop = (y*vars.tileSize) +16, id = id))
    s.addAction(RemoveEntity(id=id))
    s.addAction(CallFunc(f = score))
    example.play(s)