コード例 #1
0
ファイル: funcs.py プロジェクト: yasminsadi/games
 def f():
     vars.warp_func = None
     s = Script()
     s.addAction (act.SetState(tag='player', state='warp'))
     s.addAction (act.Move(speed=50, by =[0,-64], tag='player'))
     if newCamBounds:
         s.addAction (act.ChangeCamBounds('maincam', newCamBounds[0], newCamBounds[1], newCamBounds[2], newCamBounds[3]))
     s.addAction (act.Move(speed=0, to = [warpTo[0] * vars.tileSize, warpTo[1]*vars.tileSize], immediate= True, tag = 'player'))
     s.addAction (act.SetState(tag='player', state='walk'))
     example.play(s)
コード例 #2
0
ファイル: funcs.py プロジェクト: yasminsadi/games
 def f(player, hotspot):
     s = Script()
     s.addAction (act.SetState(tag='player', state='demo', args = { 'left': 0 })),
     s.addAction (act.Delay (sec=1))
     s.addAction (act.SetState(tag='player', state='warp'))
     if newCamBounds:
         s.addAction (act.ChangeCamBounds('maincam', newCamBounds[0], newCamBounds[1], newCamBounds[2], newCamBounds[3]))
     s.addAction (act.Move(speed=0, to = [warpTo[0] * vars.tileSize, warpTo[1]*vars.tileSize], immediate= True, tag = 'player'))
     s.addAction (act.Move(speed=50, by =[0, 64], tag='player'))
     s.addAction (act.SetState(tag='player', state='walk'))
     example.play(s)
コード例 #3
0
ファイル: funcs.py プロジェクト: yasminsadi/games
def flag(p, h):
    p.vx = 0
    p.vy = 0
    example.remove(h.id())
    flag = example.get('flag')
    s = Script()
    s.addAction(act.SetState (state = 'warp', tag='player', args = {'anim': 'slide'}), id = 0)
    s.addAction (act.Move (speed = 80, by = [0, -(flag.y()-h.y())], tag='flag'), after= [0])
    s.addAction (act.Move (speed = 80, to = [p.x(), h.y()], tag='player'), after= [0])
    s.addAction (act.SetState(tag='player', state='demo', args = { 'left': 0 })),
    #s.addAction (act.SetState (state='walk', tag='player'))
    example.play(s)
コード例 #4
0
def m3(x: float, y: float):
    a = spr('score100', x, y)
    main = example.get('main')
    id = main.add(a)
    s = Script()
    s.addAction(act.Move(speed=100, by=[0, 64], id=id))
    s.addAction(act.RemoveEntity(id=id))
    example.play(s)
コード例 #5
0
def m1(x: float, y: float):
    a = mushroom(x, y)
    main = example.get('main')
    id = main.add(a)
    s = Script()
    s.addAction(act.Move(id=id, speed=10, by=[0, 16]))
    s.addAction(act.SetState(id=id, state='walk'))
    example.play(s)