#Please review my Flappy Bird clone

61 messages · Page 1 of 1 (latest)

past summit
narrow talon
#

will do

#
.despawn_descendants().despawn();

here in the main_meu exist system could just use .despawn_recursive()

#

look a little nicer

past summit
#

i used that also in the game::exit i think

narrow talon
#

ah okay tiny thing anywys

#

adding the default plugins and window config in the GamePlugin is a bit weird though

#

especially since winit settting are done in main.rs as well

past summit
#

thats because i started with game.rs as my main and moved it to a different file after i started working on the main menu

#

should've moved the plugins to main.rs

narrow talon
#

ah okay

#

its nothing bad anyways

#
fn delete_offscreen_entities(
    entities: Query<(Entity, &Transform), Without<Bird>>,

the Without<Bird> seems very useless since the bird will never be affected anways

past summit
#

i wanted to be careful

narrow talon
#

i feel like using rapier CollisionEvents might be an easier and more practical way of doing the collision detection work (just a suggestion, i never used rapier myself before)

#

a small thing would also be that if a module (for example main_meu) contains only one file it should simply be a file (so instead of main_menu/mod.rs just do main_menul.rs)

#

the cloud_spawn system is a bit hard to read

#

not super horrible though

past summit
#

yea its by far not the easiest

#

i still find mainmenu the worst tho

narrow talon
#

oh yeah

#

but that's ui so i can exuse it

past summit
#

fair enough

somber oracle
#

Small thing but changing

#[derive(Resource)]
pub struct Score(u32);

to

#[derive(Resource, Deref, DerefMut)]
pub struct Score(u32);

would allow you to change score.0 += 1; to score += 1; iirc

narrow talon
#

true

#

but not really neccesary

past summit
#

that is very useful to know

somber oracle
#

true

narrow talon
#

tbh i also forgot about Deref and DerefMut

#

All in all its pretty good

#

well organised code imo

somber oracle
#

Yea looking good

past summit
#

cool

somber oracle
#

To me it seems a bit odd that bird_pipe_collide also increases the score

#

I named my scoring system just scoring_system afaik

#

or just scoring

past summit
#

yea i should’ve moved the scoring into another function

narrow talon
#

oh another little thing to keep in mind for bigger projects

#

using time.delta_seconds() can be a really bad idea

#

usualy you should cap it

#

so for example time.delta_seconds().min(1.0)

#

here it doesn't matter though

past summit
#

im guessing thats to avoid an overflow

narrow talon
#

nope

#

the problem comes down to when lag happens

#

if you use time.delta_seconds() there is a chance that will cause a side effect that will create furhter lag

#

which will quickly cause your game to go in a death spiral of lag

#

this is especially problematic if you put it into something like a phsics engine

#

in this case extreme lag (which will never happen, so it doesn't matter) might cause a new pipe to be spawned every other frame

past summit
#

i noticed this i think when i tabbed out which is why i set the winnit settings like this so it didn’t lag when i tabbed out i didnt know the reason for it

#

oh

#

i also forgot to make a check for if the player goes off screen

narrow talon
#

can that even happen?

#

oh yes it can go above the top

#

funny exploit

past summit
#

don’t get points tho soooo

narrow talon
#

well then it doesn't matter you can

narrow talon
#

sure it only remove a a .0 from something.0 but still

#

well only for Deref anways

#

that value should not be changed