r.add( se.WalkArea(tag='walkarea', shape=sh.Polygon(outline=[ 0, 24, 123, 63, 199, 63, 299, 30, 377, 30, 385, 35, 454, 35, 470, 0, 0 ]), depth=sh.LinY(y0=0, z0=1, y1=144, z1=0)), 'main') r.addItem(id='village2.archway') r.addItem(id='village2.village3') r.addItem(id='lmf') r.addItem(id='citizen', parent='walkarea') r.addItem(id='lmf1', parent='walkarea') r.addItem(id='lmf2', parent='walkarea') r.addItem(id='lmf3', parent='walkarea') r.addItem(id='village2.rat', parent='walkarea') r.addItem(id='village2.fakedoor1') r.addItem(id='village2.fakedoor2') r.addItem(id='village2.fakedoor3') r.addItem(id='village2.fakedoor4') r.addItem(id='village2.door', anim=var.doors.village_voodoolady) r.addDynamicItems() r.init.append(init) #print (State.items['scummbar.door.out'].walkto) return r engine.addRoom(id=roomId, f=builder)
def builder(): r = Phy2DRoom(id='test1', width=256, height=256,worldWidth= 256,worldHeight= 256) # add player p = Entity( pos = [160, 100]) shape_player = Rect (10, 20, offset=[-5,-10]) p.addComponent (ShapeGfxOutline(shape_player, color=[255, 255, 255, 255])) p.addComponent (Collider(flag=var.Flags.player, mask = var.Flags.wall, tag = var.Tags.player, shape = shape_player)) sm = StateMachine('walk') sm.states.append(Walk3D('walk', 5)) p.addComponent(sm) p.addComponent(KeyInput()) r.add (p, 'main') # add object o1 = Entity (pos= [200,170]) o_shape = Rect(20,10) o1.addComponent (ShapeGfxOutline(o_shape, color=[255,255,255,255])) o1.addComponent (Collider(flag=var.Flags.wall, mask = var.Flags.player, tag= var.Tags.wall, shape=o_shape)) r.add(o1, 'main') r.add (s(10,80,Line(A=[0,0],B=[50,25])), 'main') r.add (s(30,130,PolygonSimple(outline=[0, 0, 10, 0, 5, 20])), 'main') r.add (s(150,30,Circle(20)), 'main') r.add (s(190,20,PolygonTri(outline=[0,0,10,10,10,20,20,20,20,0,30,0,30,40,20,40,20,30,0,30])), 'main') #r.add (s(-150,80,Line(A=[0,0],B=[50,25])), 'main') return r engine.addRoom (id = 'test1', f=builder)
wall = Entity() wall.pos=[0,100,-0.01*100] wall.addComponent (ShapeGfx(shape = Polygon([0,0,100,0,100,100,0,100]), texture='gfx/wall1.png', repx=32, repy=32)) r.main.add(wall) r.main.add(b.makeStaticItem (ti.tree1, 50, 80)) #ba=Entity() #ba.addComponent(compo.ShapeGfxColor(shape=sh.Rect(200,100), color=[255,255,255,255])) #r.main.add(ba) # with open(example.dir+ '/rooms/world1_1.yaml') as f: # rooms = yaml.load(f, Loader=yaml.FullLoader) # for a in rooms['room']: # f = a['template'][0] # args = a['template'][1:] # print (args) # method_to_call = getattr(fact, f, None) # if method_to_call: # template = method_to_call(*args) # print (f + ' found') # for im in a['d']: # print (im) # e = template(*im) # r.addToDynamicWorld(e) # else: # print (f + ' not found') return r engine.addRoom (id = 'world1_1', f=builder)
r.addItem(id='scummbar.fireplace', parent='walkarea') # pirates r.addItem(id='scummbar.mancomb') # r.add (se.Sprite (item = 'scummbar.estevan', model = 'scummbar.estevan', pos = [164, 21, 1]), 'main') # r.add (se.Sprite (item = 'scummbar.loom', model = 'scummbar.loom', pos = [260, 17, 1]), 'walkarea') # r.add (se.Sprite (item = 'scummbar.pirate1', model = 'scummbar.pirate1', pos = [138, 38, -1]), 'main') # r.add (se.Sprite (model = 'scummbar.pirate2', pos = [124,20,-1], tag = 'scummbar.pirate2'), 'main') # r.add (se.Sprite (model = 'scummbar.pirate3', pos = [30,0,-1], tag = 'scummbar.pirate3'), 'walkarea') # r.add (se.Sprite (item = 'scummbar.pirate4', model = 'scummbar.pirate4', pos = [0, 0, -1]), 'walkarea') # r.add (se.Sprite (model = 'scummbar.pirate5', pos = [200,18,1], tag = 'scummbar.pirate5'), 'main') # r.add (se.Sprite (model = 'scummbar.pirate6', pos = [160,0,1], tag = 'scummbar.pirate6'), 'main') # r.add (se.Sprite (model = 'scummbar.pirate7', pos = [255,38,1], tag = 'scummbar.pirate7'), 'walkarea') # r.add (se.Sprite (model = 'scummbar.pirate8', pos = [215,44,1], tag = 'scummbar.pirate8'), 'walkarea') # r.add (se.Sprite (model = 'scummbar.pirate9', pos = [278,40,1], tag = 'scummbar.pirate9'), 'walkarea') # r.add (se.Character (model='ilp1', speed = 100, dir = 'e', # state='idle', text_color=[85, 85, 255, 255], text_offset=[0,60], pos = [376, 11, 0.95]), 'walkarea') # r.add (se.Character (model='ilp2', speed = 100, dir = 'e', # state='idle', text_color=[255, 255, 85, 255], text_offset=[0,60], pos = [413,11,0.95]), 'walkarea') # r.add (se.Character (model='ilp3', speed = 100, dir = 'e', # state='idle', text_color=[255, 85, 255, 255], text_offset=[0,60], pos = [444,18,0.95]), 'walkarea') # r.add (se.Sprite (item = 'scummbar.important_looking_pirates', pos=[370,30,0]), 'main') # r.init.append (animate) # r.init.append (cook) r.addDynamicItems() return r engine.addRoom(id='scummbar', f=builder)
from lib_py.scumm.room import RoomDialogue from lib_py.script import Script import lib_py.scumm.entity as se import lib_py.scumm.actions as sa import lib_py.engine as engine import example st = engine.data['strings'] sl = st['dialogues']['mancomb'] def f(): s = Script() s.addAction(sa.Say(lines=[sl[1], sl[2]], tag='mancomb.mancomb')) s.addAction(sa.StartDialogue(dialogueId='mancomb')) example.play(s) def builder(): r = RoomDialogue(id='scummbar') r.add(se.BackgroundItem(image='gfx/mancomb.png', pos=[0, 0, -1]), 'main') r.addItem(id='mancomb.mancomb') #r.addItem (id = 'guybrush.dialogue') r.init.append(f) return r engine.addRoom(id='mancomb', f=builder)
# # sfondo = entity.Entity() # # sfondo.addComponent (compo.Gfx(image='gfx/lookout_1.png')) # # { pos = {81, 16, 3}, components = { { type="gfx", image="lookout_2.png" }}}, # # { pos = {294, 33, 3}, components = { { type="gfx", image ="lookout_3.png" }}}, # # { pos = {226, 0, 3}, components = { { type="gfx", image="lookout_4.png" }}}, # # r.add(sfondo, 'main') # r.add (se.BackgroundItem(image='gfx/lookout_1.png', pos = [0,0,-1]), 'main') # r.add (se.BackgroundItem(image='gfx/lookout_2.png', pos = [81, 16, 3]), 'main') # r.add (se.BackgroundItem(image='gfx/lookout_3.png', pos = [294, 33, 3]), 'main') # r.add (se.BackgroundItem(image='gfx/lookout_4.png', pos = [226, 0, 3]), 'main') # r.add (se.WalkArea (tag='walkarea', shape = sh.Polygon ( # outline = [203,51,315,62,315,40,293,40,260,10,260,0,260,-20,234,-20,234,0,234,10,221,26,152,33,152,51] # ), depth=sh.LinY(y0=0,z0=1,y1=144,z1=0)), 'main') # r.addItem(id='lookout.stairs') # r.addItem(id='lookout.fire', parent='walkarea') # r.addItem(id='lookout', parent = 'walkarea') # #r.add (se.Sprite (model = 'fire', pos = [126, 52, 0]), 'walkarea') # #r.add (se.Sprite (item = 'lookout.stairs', pos = [230,0,0]), 'main') # #r.add (se.Character (item='lookout.lookout', model='lookout', speed = 100, dir = 'w', state='idle', text_color=[170, 170, 170, 255], text_offset=[0,60], pos = [114,36,0]), 'walkarea') # r.addDynamicItems() # #r.init.append(a1) # #r.add() # return r engine.addRoom(id='lookout', f=builder) #settings.monkey.rooms['lookout'] = builder #settings.engine['rooms']['lookout'] = builder
r.add(se.BackgroundItem(image='gfx/village1_1.png', pos=[0, 0, -1]), 'main') r.add(se.BackgroundItem(image='gfx/village1_2.png', pos=[73, 0, 1]), 'main') r.add(se.BackgroundItem(image='gfx/village1_3.png', pos=[229, 0, 1]), 'main') r.add(se.BackgroundItem(image='gfx/village1_4.png', pos=[606, 0, 1]), 'main') r.add( se.WalkArea(tag='walkarea', shape=sh.Graph(nodes=[[8, 71], [23, 63], [49, 49], [40, 37], [56, 24], [84, 13], [770, 13], [780, 34], [1000, 34]], edges=[[0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 8]]), scale=sh.LinY(y0=0, z0=0.8, y1=144, z1=0.1), depth=sh.LinY(y0=0, z0=1, y1=144, z1=0)), 'main') r.addItem(id='village1.poster') r.addItem(id='village1.door', anim=var.doors.village_scummbar) r.addItem(id='village1.cliffside') r.addItem(id='village1.archway') r.addDynamicItems() r.init.append(init) #print (State.items['scummbar.door.out'].walkto) return r engine.addRoom(id='village1', f=builder)