def settarget(self): if self.progress > 1: sound.play("yes") if self.progress == 1: hud.show("Use arrow keys or WASD to move.") dialog.play("intro1") elif self.progress == 2: hud.clear() elif self.progress == 4: hud.show("Hold space (or enter, shift, or Z) and use arrows to teleport between ships.") dialog.play("intro2") elif self.progress == 5: hud.clear() elif self.progress == 6: dialog.play("intro3") elif self.progress == 10: dialog.play("intro4") if self.progress in (1, 2, 3, 5, 6, 8): dx, dy = self.tps[self.progress] state.target = thing.Target(X = dx / window.camera.y0, y = window.camera.y0 - dy) state.effects.append(state.target) elif self.progress in (4, 7, 9): state.target = None # better chance of getting something not obscured by the HUD if self.progress == 4: state.target = state.ships[-1] while state.target in (None, state.you): state.target = random.choice(state.ships) state.effects.append(thing.ShipTarget(parentid = state.target.thingid))
def settarget(self): if self.progress > 1: sound.play("yes") if self.progress == 1: hud.show("Use arrow keys or WASD to move.") dialog.play("intro1") elif self.progress == 2: hud.clear() elif self.progress == 4: hud.show("Hold space (or enter, shift, or Z) and use arrows to teleport between ships.") dialog.play("intro2") elif self.progress == 5: hud.clear() elif self.progress == 6: dialog.play("intro3") elif self.progress == 10: dialog.play("intro4") if self.progress in (1, 2, 3, 5, 6, 8): dx, dy = self.tps[self.progress] state.target = thing.Target(X=dx / window.camera.y0, y=window.camera.y0 - dy) state.effects.append(state.target) elif self.progress in (4, 7, 9): state.target = None # better chance of getting something not obscured by the HUD if self.progress == 4: state.target = state.ships[-1] while state.target in (None, state.you): state.target = random.choice(state.ships) state.effects.append(thing.ShipTarget(parentid=state.target.thingid))
def init(): image.cache.clear() hud.clear() quest.quests["Act1"].available = True state.shipyard = { "Skiff": 600, "Mapper": 600, "Beacon": 600, } state.you = thing.Skiff(X=0, y=state.R - 5, vx=1) state.ships = [state.you] state.mother = thing.Mother(X=0, y=state.R + 8) state.objs = [state.mother] # state.filaments = [thing.Filament(ladderps = state.worlddata["filaments"][0])] state.hazards = [] for _ in range(500): X = random.uniform(0, math.tau) y = math.sqrt(random.uniform(state.Rcore**2, state.R**2)) state.hazards.append(thing.Slash(X=X, y=y)) for filament in state.worlddata["filaments"]: for j in range(len(filament) - 1): X0, y0 = filament[j] X1, y1 = filament[j + 1] dX, dy = X1 - X0, y1 - y0 state.hazards.append(thing.Rung(X=X0, y=y0)) state.hazards.append(thing.Rung(X=X0 + dX / 3, y=y0 + dy / 3)) state.hazards.append( thing.Rung(X=X0 + dX * 2 / 3, y=y0 + dy * 2 / 3)) window.camera.follow(state.you) window.camera.think(0) populatefull() sound.playgamemusic()
def init(): image.cache.clear() hud.clear() quest.quests["Act1"].available = True state.shipyard = { "Skiff": 600, "Mapper": 600, "Beacon": 600, } state.you = thing.Skiff(X = 0, y = state.R - 5, vx = 1) state.ships = [state.you] state.mother = thing.Mother(X = 0, y = state.R + 8) state.objs = [state.mother] # state.filaments = [thing.Filament(ladderps = state.worlddata["filaments"][0])] state.hazards = [] for _ in range(500): X = random.uniform(0, math.tau) y = math.sqrt(random.uniform(state.Rcore ** 2, state.R ** 2)) state.hazards.append(thing.Slash(X = X, y = y)) for filament in state.worlddata["filaments"]: for j in range(len(filament) - 1): X0, y0 = filament[j] X1, y1 = filament[j+1] dX, dy = X1 - X0, y1 - y0 state.hazards.append(thing.Rung(X = X0, y = y0)) state.hazards.append(thing.Rung(X = X0 + dX / 3, y = y0 + dy / 3)) state.hazards.append(thing.Rung(X = X0 + dX * 2 / 3, y = y0 + dy * 2 / 3)) window.camera.follow(state.you) window.camera.think(0) populatefull() sound.playgamemusic()