ucsd-cse125-sp24 / group5

A character-based ability shooter 2v2 heavily inspired by Four Seasons
https://cse125.ucsd.edu/2024/cse125g5
6 stars 0 forks source link

Animations experimentation #18

Closed Melody-Ruth closed 2 months ago

Melody-Ruth commented 2 months ago

The bears move around now, with animation vs no animation based on whether they are moving and the animation frame displayed based on time since starting that animation. To add a new model of an existing general type (e.g. players), put the new glb file in models, add the file name to the vector in sge::loadModels, add another value to the ModelIndex enum, and set the animation frame when still in sge::loadModels using setStillAnimation. To add more animations to an existing general type (e.g. players), add another value to the PlayerAnimations enum in ClientGame, update the glb files for each of the models to include their versions of the new animation, and add logic to ClientGame that sets their animation to be the new animation in the appropriate circumstances. To add a completely new general type (e.g. the egg has a different set of animations from the player), add a new EggAnimations enum to ClientGame, and add a new vector to ClientGame similar to playerIndices to keep track of which movement entities fall into this category. Then you can proceed with adding models/animations according to the earlier instructions. (I know it's messy how everything is spread between the ClientGame, the Client, and the sge stuff. I tried to do good abstraction things first and it became so much worse. This is the best I could come up with that wasn't ridiculous to implement/use, but obviously I'm open to ideas for how to make it cleaner)

benjxia commented 2 months ago

looks good