#Rust port of Celeste

13 messages · Page 1 of 1 (latest)

sharp arrow
sour crest
#

wow cool, did you port it all manually, or did you use a tool for some things?

sharp arrow
#

100% manually, with struggles and pain

sour crest
#

🥲

#

it's probably hard to review a 3200 line file

#

it's interesting that some function take a ton of arguments, like ```rs
#[allow(clippy::too_many_arguments)]
fn draw<T>(
&mut self,
draw: &mut DrawContext,
objects: &mut T,
room: Vec2<i32>,
got_fruit: &[bool],
frames: i32,
max_djump: &mut i32,
shake: &mut i32,
freeze: &mut i32,
flash_bg: &mut bool,
new_bg: &mut bool,
pause_player: &mut bool,
seconds: i32,
minutes: i32,
deaths: i32,
) -> UpdateAction

sharp arrow
#

I think it was partly fighting with the borrow checker, the original game uses a bunch of global variables which I just bunched together, and then had to suffer to get them to the right places

sour crest
#

I see

#

well, good luck ferrisBut

#

I don't have much to say, my eyes glaze over the code

sharp arrow
#

No worries, it's a bit of a mess

idle verge
#

holy moly

hazy marsh
#

probably the place to go with the bunch of globals would be to throw them all in a struct, and then when you find borrowing problems, split that struct into smaller structs that are inside the big struct