Showing results for

player

movement

on tomassedovic.github.io
tomassedovic.github.io › roguelike tutorial › part 5 combat.html
Preparing for combat
...monster.alive = true;
objects.push(monster);
And in handle_keys
, we’ll change the movement code from
player.move_by(0, -1, game)
tomassedovic.github.io › roguelike tutorial › part 11 dungeon progression…
Dungeon levels and character progression
...Text, .. }, "c", true) => {
// show character information
let player = &objects[PLAYER];
let level = player.level;
let level_up_xp = LEVEL_UP_BASE + player.level * LEVEL_UP_FACTOR;
tomassedovic.github.io › roguelike tutorial › part 2 object map.html
The object and the map
...fn handle_keys(tcod: &mut Tcod, player: &mut Object) -> bool {
// ...
// movement keys
Key { code: Up, .. } => player.move_by(0, -1),
Key { code: Down, .. } => player.move_by(0...
tomassedovic.github.io › roguelike tutorial › part 6 going berserk.html
Going Berserk!
...let (player, target) = mut_two(PLAYER, target_id, objects);
player.attack(target);
That’s it, the player and the monsters can beat each other silly, but...
tomassedovic.github.io › roguelike tutorial › part 7 gui.html
The GUI
...When the player doesn’t take a turn (doesn’t press a movement/attack
key), handle_keys
returns a specific PlayerAction
value(DidntTakeTurn
). You’ll...
tomassedovic.github.io › roguelike tutorial › part 1 graphics.html
Graphics
...update
the player’s position if it’s one of the arrow keys:
let key = tcod.root.wait_for_keypress(true);
match key {
// movement keys