speech bubbles and delays
This commit is contained in:
@@ -128,9 +128,9 @@ fn move_cost_rate_limits_repeated_moves() {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn blocked_move_still_costs_cooldown() {
|
||||
// A move into a wall fails but still charges the 250 ms cooldown, so a second
|
||||
// queued move (into open space) is delayed just as a successful move would be.
|
||||
fn inline_delay_paces_subsequent_moves() {
|
||||
// move() always appends a Delay(250 ms) to the queue, so a second queued move
|
||||
// is held back by that delay even if the first move was blocked by a wall.
|
||||
let mut board = open_board(
|
||||
3,
|
||||
3,
|
||||
@@ -144,7 +144,7 @@ fn blocked_move_still_costs_cooldown() {
|
||||
// First (eastward) move is blocked by the wall: object hasn't moved.
|
||||
assert_eq!((game.board().objects[&1].x, game.board().objects[&1].y), (1, 1));
|
||||
|
||||
// The blocked move charged the cooldown, so South is still pending here.
|
||||
// The Delay(250 ms) appended by move(East) is still live, so South is pending.
|
||||
game.tick(Duration::from_millis(100));
|
||||
game.tick(Duration::from_millis(100));
|
||||
assert_eq!((game.board().objects[&1].x, game.board().objects[&1].y), (1, 1));
|
||||
|
||||
@@ -4,7 +4,7 @@ use crate::board::tests::{crate_at, open_board, stamp, wall_at};
|
||||
use crate::game::GameState;
|
||||
use crate::glyph::Glyph;
|
||||
use crate::object_def::ObjectDef;
|
||||
use crate::script::Direction;
|
||||
use crate::utils::Direction;
|
||||
|
||||
#[test]
|
||||
fn pushing_a_crate_reveals_the_floor_underneath() {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use std::time::Duration;
|
||||
use crate::board::tests::open_board;
|
||||
use crate::game::GameState;
|
||||
use crate::script::Direction;
|
||||
use crate::utils::Direction;
|
||||
use super::{board_with_object, scripted_object, log_texts};
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user