draw static sprites#21
Conversation
|
|
||
| pub fn get_sprite(&self, index: usize) -> &(CompShape, Vec<u8>) { | ||
| &self.sprites[index] | ||
| &self.sprites[index - 21] |
There was a problem hiding this comment.
What does this magic number mean?
There was a problem hiding this comment.
for some reason there's an offset between the number stored in the map tiles and the picnum in the sprites file. In wolf4sdl it's 23, and the extra +2 I don't remember where it's coming from, but it was necessary for it to match with the correct sprite. (we should make these constants)
| // where does this value come from? | ||
| pub const TILE_SIZE: f64 = 4.8; |
There was a problem hiding this comment.
I'm also quite interested in the calculations behind this value :p
There was a problem hiding this comment.
iirc this was 4 in the initial implementation by @qhool. Not sure how he came up with that number, but the walls looked a bit short so I increased it in a previous PR until it seemed to roughly match the original game (there may be some accurate way to come up with this number)
still has bugs with sprite sizes and angle handling