Esempio n. 1
0
    def new_game(self):
        Maze.__init__(self, self.total_rooms)
        self.items = []
        self.tiles = defaultdict(Tile)
        self.root = render.attach_new_node("map_root")
        self.static = self.root.attach_new_node("map-static")
        self.unlit = render.attach_new_node("map-unlit")
        self.backsides = self.root.attach_new_node("map-backsides")
        self.dynamic = render.attach_new_node("map-dynamic")
        self.enemies = []
        self.rooms = {}
        self.rooms_visited = 0
        self.current_set = 0
        self.tile_set = self.tile_sets[self.sets[self.current_set]]
        self.dynamic.hide(0b001)
        base.player.root.hide(0b001)
        for target_np in [
                self.static,
                self.backsides,
                self.unlit,
                self.dynamic,
        ]:
            target_np.set_attrib(
                LightRampAttrib.make_single_threshold(0.0, 1.0))
            target_np.set_light(base.fov_point_np)
        base.fov_point_np.reparent_to(base.player.root)
        base.fov_point.set_scene(self.root)

        p = self.pos(8)
        self.rooms[p] = Room(*p)
        base.player.root.set_pos((p[0] + 4, -p[1] - 4, 0))
        base.player.reset()
Esempio n. 2
0
 def __set_toon():
     tempnode = NodePath(PandaNode('temp node'))
     tempnode.setAttrib(LightRampAttrib.make_single_threshold(.5, .4))
     tempnode.set_shader_auto()
     base.cam.node().set_initial_state(tempnode.get_state())
     CommonFilters(base.win, base.cam).set_cartoon_ink(separation=1)