def initialize(self): #bgmusic = load_bgmusic("palette.mp3") #bgmusic.play() self.background = Two_D.loadBackground() base.cam2dp.node().getDisplayRegion(0).setSort(-20) self.candyOnBoard = False self.playerCandyCount, self.pokemonCandyCount = 2, 0 ######################Rare Candy############################### pokes=['caterpie', 'charmander', 'geodude'] self.myPokesDark = Two_D.loadMyPokemon_Dark(pokes) # my pokemons self.myPokesBright = Two_D.loadMyPokemon_Bright() groupHide(self.myPokesBright) self.loadRareCandy() # load rare candy ######################Camera Initialization#################### self.CAM_R, self.CAM_RAD = 12, 0 camera.setPos(_FOCUS[0],_FOCUS[1]-12,_FOCUS[2]+25) camera.setHpr(0, -65, 0) self.cameraSpinCount, self.cameraZoomCount = 0, 0 self.changingFocus = False self.spin = 0 #######################ICONS################################### self.myIcon = Two_D.loadMyIcon() self.pokeIcon = Two_D.loadPokeIcon() self.playerCandyStatus = candyStatus(0, self.playerCandyCount) #######################FLAMES################################## base.enableParticles() self.fireCounter = 0 self.onFire = False #######################STRINGSHOT############################# self.stringCounter = 0 #######################GLOBALS################################# self.i = 0 self.myDirection = ['zx', 'zy'] self.rockCounter = 0 self.rockX, self.rockY = None, None self.rockOnMaze = False self.pokeMoveChoice = None self.myPokeName = None self.arrowKeyPressed = False self.pokemonDirection = 'd' self.mouseX, self.mouseY = None, None # direction the ball is going self.jerkDirection = None base.disableMouse() self.jerk = (0,0,0) self.MAZE = Model_Load.loadLabyrinth() Control.keyControl(self) self.loadPokemonLevel1() self.light() self.loadBall() self.pokeStatus = 0 # 0 is normal, 1 is burned, 2 is slow-speed ########################################ROCK################### self.rock = Model_Load.loadRock() self.rock.reparentTo(render) self.rock.hide() # Do not show, but load beforehand for performance
def initialize(self): taskMgr.stop() self.musicCounter, self.clock = 0, 0 self.gameOverCounter = 0 self.clockMSG = None self.music = load_bgmusic(_BGMUSIC[0]) self.background = loadBackground() base.cam2dp.node().getDisplayRegion(0).setSort(-20) self.candyOnBoard = False self.playerCandyCount, self.pokeCandyCount = 0, 0 self.gameOver = False self.displayInformation() self.instStatus = "show" ######################Rare Candy############################### pokes=['caterpie', 'charmander', 'geodude'] self.myPokesDark = loadMyPokemon_Dark(pokes) # my pokemons self.myPokesBright = loadMyPokemon_Bright() groupHide(self.myPokesBright) self.loadRareCandy() # load rare candy ######################Camera Initialization#################### self.CAM_R, self.CAM_RAD = 12, 0 camera.setPos(_FOCUS[0],_FOCUS[1]-12,_FOCUS[2]+25) camera.setHpr(0, -65, 0) self.cameraSpinCount, self.cameraZoomCount = 0, 0 self.changingFocus = False self.spin = 0 #######################ICONS################################### self.myIcon = loadMyIcon() self.pokeIcon = loadPokeIcon() self.playerCandyStatus = candyStatus(0, self.playerCandyCount) self.pokeCandyStatus = candyStatus(1, self.pokeCandyCount) self.rareCandyImage = loadRareCandyImage() self.pokeRareCandyImage = loadRareCandyImage(pos=(-.3,0,-.75)) #######################FLAMES################################## base.enableParticles() self.fireCounter = 0 self.onFire = False #######################STRINGSHOT############################# self.stringCounter = 0 #######################THUNDER################################ self.thunderCounter = 0 #######################SOUND################################## self.dangerous = load_sound("pikachu_d.wav") self.safe = load_sound("pikachu_s1.wav") self.use = load_sound("pikachu_u.wav") #######################"GLOBALS"############################## self.speedCounter = 0 self.onThunder = False self.direction = 's' self.myDirection = ['zx', 'zy'] self.rockCounter = 0 self.rockX, self.rockY = None, None self.rockOnMaze = False self.pokeMoveChoice = None self.myPokeName = None self.arrowKeyPressed = False self.pokemonDirection = 'd' self.mouseX, self.mouseY = None, None # direction the ball is going self.jerkDirection = None base.disableMouse() self.jerk = Vec3(0,0,0) self.MAZE = Model_Load.loadLabyrinth() Control.keyControl(self) self.loadPokemonLevel1() self.light() self.loadBall() self.pokeStatus = 0 # 0 is normal, 1 is burned, 2 is slow-speed ########################################ROCK################### self.rock = Model_Load.loadRock() self.rock.reparentTo(render) self.rock.hide() # Do not show, but load beforehand for performance