goku
goku game engine_en
goku game engine_en
  • Chapter 1: Introduction to SDL2, Rust, and goku
  • Chapter2: The Base Structure: SpriteSheet
  • Chapter 3: Animated Textures
  • Chapter 4: Handling Textures: TextureManager
  • Chapter 5: Bringing Textures to Life: GameObject
  • Chapter 6: The Foundation: Tile System
  • Chapter 7: Moving the View: Camera
  • Chapter 8: Particle System
  • Chapter 9: The User Interface Layer
  • Chapter 10: The Button Element
  • Chapter 11: The Text Box Element
  • Chapter 12: The Checkbox Element
  • Chapter 13: The Slider Element
  • Chapter 14: The Audio System
  • Chapter 15: The AI System
  • Chapter 16: The Window System
  • Chapter 17: User Input Handling
  • Chapter 18: Rendering a Parallax Background
  • Chapter 19: Timing and Frame Rate Management
  • Chapter 20: Conclusion
Powered by GitBook
On this page

Chapter 3: Animated Textures

An AnimatedTexture is a structure that extends the functionality of the SpriteSheet by adding a time delay between frames, which allows for the animation of the sprite.

  • sprite_sheet: This field contains the reference to the SpriteSheet to be animated.

  • frame_delay: This field sets the time delay between frame changes, giving control over the animation speed.

  • current_frame: The index of the current frame of the sprite being rendered.

  • last_frame_time: The time at which the frame was last updated.

PreviousChapter2: The Base Structure: SpriteSheetNextChapter 4: Handling Textures: TextureManager

Last updated 1 year ago