Showing results for
on rogueliketutorials.com...Depending on whether or not its the players turn, we want to control the
player’s movement. The player can only move on the...
player’s movement. The player can only move on the...
Part 8 - Items and Inventory
So far, our game has movement, dungeon exploring, combat, and AI (okay, we’re stretching the meaning of “intelligence...
So far, our game has movement, dungeon exploring, combat, and AI (okay, we’re stretching the meaning of “intelligence...
...By using the same movement keys we use to move the player around, we can move the cursor around, with a few extra options...
...For the player, that’s easy enough; we just need to update handle_keys
to allow us to move diagonally. Modify the movement part of...
to allow us to move diagonally. Modify the movement part of...
...movement so that the Entity class handles the actual movement.
if move:
dx, dy = move
- player_x += dx
- player_x += dy
if move:
dx, dy = move
- player_x += dx
- player_x += dy
...action = WaitAction(player) ...
The MOVE_KEYS
dictionary holds various different possibilities for movement. Some roguelikes utilize the numpad for movement, some use “Vi Keys.” Ours...
The MOVE_KEYS
dictionary holds various different possibilities for movement. Some roguelikes utilize the numpad for movement, some use “Vi Keys.” Ours...
...GameMap
def __init__(self, player: Actor):
self.event_handler: EventHandler = MainGameEventHandler(self)
+ self.message_log = MessageLog()
self.player = player
def __init__(self, player: Actor):
self.event_handler: EventHandler = MainGameEventHandler(self)
+ self.message_log = MessageLog()
self.player = player
...movement so that the Entity class handles the actual movement.
if isinstance(action, MovementAction):
- player_x += action.dx
- player_y += action.dy
+ player...
if isinstance(action, MovementAction):
- player_x += action.dx
- player_y += action.dy
+ player...
...player = self.engine.player
key = event.sym
index = key - tcod.event.K_a
if 0 <= index <= 26:
try:
key = event.sym
index = key - tcod.event.K_a
if 0 <= index <= 26:
try:
...character_screen(player, 30, 10, screen_width, screen_height)
Final thing before we wrap up this chapter: Awhile ago, we included
diagonal movement for the player character...
Final thing before we wrap up this chapter: Awhile ago, we included
diagonal movement for the player character...