当前位置: 首页>>代码示例>>Python>>正文


Python Scene.__init__方法代码示例

本文整理汇总了Python中scene.Scene.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Scene.__init__方法的具体用法?Python Scene.__init__怎么用?Python Scene.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在scene.Scene的用法示例。


在下文中一共展示了Scene.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from scene import Scene [as 别名]
# 或者: from scene.Scene import __init__ [as 别名]
 def __init__(self, world, initial_option=0):
     Scene.__init__(self, world)
     items=[]
     for name,level in levels.levels:
         items.append( (name, runner(self.game, level) ) )
     items.append( ("back", self.on_back) )
     self.menu = Menu(self, items, initial_option)
开发者ID:ricardoquesada,项目名称:pywii,代码行数:9,代码来源:main_menu.py

示例2: __init__

# 需要导入模块: from scene import Scene [as 别名]
# 或者: from scene.Scene import __init__ [as 别名]
    def __init__(self, game):
        Scene.__init__(self, game, ORTHOGONAL)
        self.centerMouse()
        self.ceilings = None
        self.lastPut = None
        self.horEnergy = True #riq's preferences
        self.world = world.World()
        self.ballsAtGoal = 0
        self.lost = 0
        self.llss = [] #limited life segments
        self.attractors = []
        self.root_node.background_color = CELESTE_CIELO
        self._energy = 2000
        self.cameraArea = self.CAMERA_AREA
        self.maxEnergy=3000
        import sound
        sound.playRandomSong()
        
        self.setup_level()
             
        mountainsGroup = qgl.scene.Group()
        mountainsTexture = qgl.scene.state.Texture(data.filepath("montagnas.png"))
        FACTOR= 5.5
        mountainsQuad = qgl.scene.state.Quad((2403/FACTOR,427/FACTOR))
        mountainsGroup.scale = (self.mountainScale, self.mountainScale, 0.0)
        mountainsGroup.translate = (0,-55.-70.0*(self.cameraArea[3])/500.,0)
        mountainsGroup.add(mountainsTexture, mountainsQuad)
        self.group.add(mountainsGroup)

        self.initLineGhost()
        self.group.scale = (5.0,5.0,0.0)
        self.initScores()
        self.updateScores()
        self.accept()
开发者ID:italomaia,项目名称:turtle-linux,代码行数:36,代码来源:view.py

示例3: __init__

# 需要导入模块: from scene import Scene [as 别名]
# 或者: from scene.Scene import __init__ [as 别名]
 def __init__(self, line_num, *args, **kwargs):
     self.line_num = line_num
     self.anim_kwargs = {
         "run_time" : 4.0,
     }
     self.line_num_to_method = {
         0  : self.line0,
         1  : self.line1,
         2  : self.line2,
         3  : self.line3,
         4  : self.line4,
         5  : self.line5,
         6  : self.line6,
         7  : self.line7,
         8  : self.line8,
         9  : self.line9,
         10 : self.line10,
         11 : self.line11,
         12 : self.line12,
         13 : self.line13,
         14 : self.line14,
         15 : self.line15,
         16 : self.line16,
         17 : self.line17,
         18 : self.line18,
         19 : self.line19,
     }
     Scene.__init__(self, *args, **kwargs)
开发者ID:mherkazandjian,项目名称:manim,代码行数:30,代码来源:tau_poem.py

示例4: __init__

# 需要导入模块: from scene import Scene [as 别名]
# 或者: from scene.Scene import __init__ [as 别名]
 def __init__(self):
   Scene.__init__(self)
   self._screen = Screen()
   self._player = PlayerCharacter()
   self._floor = CurrentFloor()
   self._sight = Sight(self._player)
   self._floor.put_monster(Monster())
开发者ID:bucho666,项目名称:RogueLikePrototype,代码行数:9,代码来源:dungeon.py

示例5: __init__

# 需要导入模块: from scene import Scene [as 别名]
# 或者: from scene.Scene import __init__ [as 别名]
    def __init__(self, gurls, bg_surf=None, back_color=(234,45,30), back_pos=(40,500),
                 back_size=(70,40), back_font=None):
        Scene.__init__(self)
        self.gurls = gurls  # expect three
        self.bg_surf = bg_surf
        self.done = False
        self.choice = None

        def finish():
            self.done = True
        self.buttons.add(BlockButton(finish, back_color, back_size, back_pos,
                                     text="Back", font=back_font))
        self.gurl_sprites = pygame.sprite.Group()
        gurl_pos = [(100, 100), (300, 100), (500, 100)]

        def make_choice(gurl):
            self.done = True
            self.choice = gurl

        def make_gurl_sprite(gurl):
            pos = gurl_pos.pop(0)
            sprite = GurlSprite(gurl, pos)
            sprite.on_click = lambda: make_choice(gurl)
            self.gurl_sprites.add(sprite)

        make_gurl_sprite(Kanaya())
        make_gurl_sprite(Isadora())

        self.buttons.add(self.gurl_sprites)
        self.all_sprites.add(self.buttons, self.gurl_sprites)
        self.main_surface = pygame.display.get_surface()
开发者ID:andychau,项目名称:datingsim,代码行数:33,代码来源:initiatemeet.py

示例6: __init__

# 需要导入模块: from scene import Scene [as 别名]
# 或者: from scene.Scene import __init__ [as 别名]
 def __init__(self, nrows, *args, **kwargs):
     Scene.__init__(self, *args, **kwargs)
     self.nrows            = nrows
     self.diagram_height   = 2*SPACE_HEIGHT - 1
     self.diagram_width    = 1.5*SPACE_WIDTH
     self.cell_height      = self.diagram_height / nrows
     self.cell_width       = self.diagram_width / nrows
     self.portion_to_fill  = 0.7
     self.bottom_left      = np.array(
         (-self.cell_width * nrows / 2.0, -self.cell_height * nrows / 2.0, 0)
     )
     num_to_num_mob   = {} 
     self.coords_to_mobs   = {}
     self.coords = [(n, k) for n in range(nrows) for k in range(n+1)]    
     for n, k in self.coords:
         num = choose(n, k)              
         center = self.coords_to_center(n, k)
         if num not in num_to_num_mob:
             num_to_num_mob[num] = TexMobject(str(num))
         num_mob = num_to_num_mob[num].copy()
         scale_factor = min(
             1,
             self.portion_to_fill * self.cell_height / num_mob.get_height(),
             self.portion_to_fill * self.cell_width / num_mob.get_width(),
         )
         num_mob.center().scale(scale_factor).shift(center)
         if n not in self.coords_to_mobs:
             self.coords_to_mobs[n] = {}
         self.coords_to_mobs[n][k] = num_mob
     self.add(*[self.coords_to_mobs[n][k] for n, k in self.coords])
开发者ID:astoeckley,项目名称:manim,代码行数:32,代码来源:combinatorics.py

示例7: __init__

# 需要导入模块: from scene import Scene [as 别名]
# 或者: from scene.Scene import __init__ [as 别名]
 def __init__(self):
     #Initialisation de la scene
     Scene.__init__(self)
     #Chargement de l'image de fond de la scene
     self.fond = fonction.charger_image("fond.jpg")
     #Chargement des objets
     self.bulles = bulles.Bulles() 
     self.pointeur = pointeur.Pointeur(15,24) 
     #self.pointeur.positionner(15,3) 
     self.poisson_1 = poisson.Poisson()
     self.poisson_2 = poisson.Poisson()
     self.poisson_3 = poisson.Poisson()
     self.poisson_4 = poisson.Poisson()
     
     #Chargement de la musique de fond 
     #self.musique = pygame.mixer.music.load("./sons/bouge.ogg")
     #self.musique.set_volume(0.5)
     #self.musique.fadeout(400) 
 
     #Chargement des textes à afficher
     self.texte_titre = fonction.Texte("Aquarium", 50, constante.noir)
     self.texte_stitre = fonction.Texte("Credits", 20, constante.gris)
     self.credis = credis.lire_credis()
     self.texte_credis = fonction.Texte_multiligne( (self.credis) )
     self.texte_credis.position(0, 0, 380, 65)
     self.texte_retour = fonction.Texte(" > Retour [R]",30, constante.bleufonce)
开发者ID:creasitenet,项目名称:python_pygame_aquarium,代码行数:28,代码来源:scenes.py

示例8: __init__

# 需要导入模块: from scene import Scene [as 别名]
# 或者: from scene.Scene import __init__ [as 别名]
    def __init__(self, world):
        Scene.__init__(self, world)
        self.step = 0
        self._load_background()
        self.name = text.AboutText()
        self._create_sprites()

        pyglet.clock.schedule_once(self.show_losersjuegos_logo, 4 + 3 * 2)
开发者ID:hugoruscitti,项目名称:irobotgame,代码行数:10,代码来源:about.py

示例9: __init__

# 需要导入模块: from scene import Scene [as 别名]
# 或者: from scene.Scene import __init__ [as 别名]
 def __init__(self, world, game):
     Scene.__init__(self, world)
     self.game = game
     self.step = 0
     self._create_sprites()
     self.text = text.History("Good bye robot city...")
     self.texts = []
     pyglet.clock.schedule_once(self._create_text, 3)
开发者ID:hugoruscitti,项目名称:irobotgame,代码行数:10,代码来源:post_game_scenes.py

示例10: __init__

# 需要导入模块: from scene import Scene [as 别名]
# 或者: from scene.Scene import __init__ [as 别名]
    def __init__(self, world, start_music=True):
        Scene.__init__(self, world)
        self.step = 0
        self._create_sprites()
        self.background = common.load_image('black.png')
        self.text = text.Text(MSG_START, 170, 10)

        if start_music:
            self.world.audio.play_music('intro')
开发者ID:hugoruscitti,项目名称:irobotgame,代码行数:11,代码来源:title.py

示例11: __init__

# 需要导入模块: from scene import Scene [as 别名]
# 或者: from scene.Scene import __init__ [as 别名]
    def __init__(self, game, last_option_in_main):
        Scene.__init__(self, game)
        items = [
                ("Fullscreen", self.game.fullscreen),
                ("Return", self.on_return)
                ]

        self.menu = Menu(self, items)
        self.last_option_in_main = last_option_in_main
开发者ID:ricardoquesada,项目名称:pywii,代码行数:11,代码来源:options.py

示例12: __init__

# 需要导入模块: from scene import Scene [as 别名]
# 或者: from scene.Scene import __init__ [as 别名]
 def __init__(self, director, page_number = False, previous = False, follow = False):
     '''
     Constructor
     '''
     Scene.__init__(self, director, False, page_number)
     self.previous = previous
     self.follow = follow
     self.prev_init = False          
     self.buttoms = {}
     self.buttoms[GO_SCHEME] = Buttom(config.page_btn_go_scheme_pos, config.page_btn_size, 'go_scheme_pressed'+PNG_EXT, 'go_scheme_release'+PNG_EXT, True)
开发者ID:NightZpy,项目名称:QuimicaDidactica,代码行数:12,代码来源:page.py

示例13: __init__

# 需要导入模块: from scene import Scene [as 别名]
# 或者: from scene.Scene import __init__ [as 别名]
 def __init__(self, director, background_name, continue_scene):
     '''
     Constructor
     '''
     Scene.__init__(self, director, background_name)
     for buttom in self.common_buttoms.itervalues():
         buttom.is_visible = True
     
     self.continue_scene = continue_scene         
     self.next_btn = Buttom((config.width/2, (config.height/2 + 150)), config.b_size, 'continue_pressed'+PNG_EXT, 'continue_release'+PNG_EXT, True) 
开发者ID:NightZpy,项目名称:QuimicaDidactica,代码行数:12,代码来源:sce_winner.py

示例14: __init__

# 需要导入模块: from scene import Scene [as 别名]
# 或者: from scene.Scene import __init__ [as 别名]
    def __init__(self, world, score=0):
        Scene.__init__(self, world)
        self.score = score

        self.root_node.background_color = view.CELESTE_CIELO
        am = self.actionManager = Manager()
        am.do( None,
            delay(10) +
            call(self.next)        
            )
开发者ID:italomaia,项目名称:turtle-linux,代码行数:12,代码来源:separador.py

示例15: __init__

# 需要导入模块: from scene import Scene [as 别名]
# 或者: from scene.Scene import __init__ [as 别名]
 def __init__(self, director, background_match):
     '''
     Constructor
     '''
     Scene.__init__(self, director, background_match)        
     self.definitions = Definitions()
     
     
     for buttom in self.common_buttoms.itervalues():
         buttom.is_visible = True
开发者ID:NightZpy,项目名称:QuimicaDidactica,代码行数:12,代码来源:sce_definitions.py


注:本文中的scene.Scene.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。