darienyoder / software-engineering-team-beta

http://darienyoder.com/software-engineering-team-beta/minigolf
1 stars 0 forks source link

Rendering Hierarchy #42

Open Ozpyn opened 1 week ago

Ozpyn commented 1 week ago

Looks like the arrow is hidden when the ball is in sand + (any future object that's not the canvas). We can stop this bug now by setting the drawing order/layer of the arrow to be the highest, since it's UI anyway.

Originally posted by @adietz12 in https://github.com/darienyoder/software-engineering-team-beta/issues/26#issuecomment-2359213591

There needs to be a way to define in what order the objects are rendered from bottom to top (back to front)

darienyoder commented 1 week ago

We could make an enum with names for each layer to keep everything organized.

Hunter-Jones commented 9 hours ago

I created the enum for layers to help with organization already

Although actually solving the issue of the arrow being hidden might take longer. If I understand correctly it is because lines in js do not have a layer like sprites do and is just determined its layer based on when it is created so to fix it the trajectory line would either need to be created at the start of the game moved to wherever needed or it would need to be implemented as a sprite