Closed mcccclean closed 3 years ago
Hello! I know this should not be discussed in pull request, but how did you use a sprite in your game?
@LEGOL2 I haven't used sprites really 😅 - I have just edited the font to replace some of the glyphs. So where it's showing the little guy, he is really an É
, and the parcel is actually a ≡
.
To use a custom font, it looks something like this (you will have to edit it to use the right dimensions and tile size for your game):
rltk::embedded_resource!(FONT, "../resources/cp437.png");
fn main() -> rltk::BError {
let mut gs = State::new();
gs.register_components();
raws::load_raws();
gs.insert_resources();
let (w, h) = (80, 60);
rltk::link_resource!(FONT, "resources/cp437.png");
let context = rltk::RltkBuilder::new()
.with_dimensions(w, h)
.with_tile_dimensions(16, 16)
.with_font("cp437.png", 16, 16)
.with_simple_console(w, h, "cp437.png")
.build()?;
rltk::main_loop(context, gs)
}
Sorry about the delay in looking at this; I've been snowed under with book release stuff (Hands-on Rust final ebook/paper release is coming up in June, and there's an amazing amount of work that goes into the launch) and quite unwell for a bit. I'll take a look at the PR - thanks!
@LEGOL2 There's actually a few ways to go about putting sprites in:
tiles
example in the bracket-terminal
source's examples directory for a simple version.sprites
example, also in bracket-terminal's examples directory.Writing a bit more sprite support is definitely on the menu, but I'm having to move a little slowly right now due to all my other commitments.
Hello! I've been going through the roguelike tutorial and have been having an absolute blast, thank you so much for putting this all together! It's absolutely incredible.
I've noticed that on a map that is taller than it is wide, the FOV algorithm is checking the wrong dimensions for W2SW.
I've located the offending line - will have a PR up shortly.