Chapter 15: Monogame Project Classes

Cards (39)

  • What is the final assignment of the course?
    Develop a MonoGame application
  • Why must the classes described be used in the project?
    To demonstrate understanding of the course content
  • What are the two main classes discussed in section 15.2?
    • SpriteSheet
    • AnimatedSpriteSheet
  • What does the SpriteSheet class implement?
    Functionality to show part of a Texture2D
  • What class does AnimatedSpriteSheet inherit from?
    SpriteSheet
  • Why is inheritance used for AnimatedSpriteSheet and SpriteSheet?
    To exercise inheritance and polymorphism
  • What is the base class of SpriteSheet?
    System.Object
  • What properties does SpriteSheet have?
    Texture2D, Rows, Columns, TopLeftPosition, Size
  • What does the SpriteIndex property represent?
    0-based index identifying the sprite
  • How is SpriteSize calculated?
    Using Texture2D dimensions, rows, and columns
  • What methods does SpriteSheet have?
    Update(GameTime) and Draw(SpriteBatch)
  • What is the special feature of SpriteSheetAnimation?
    Capability to move the shown sprite for animation
  • What properties are specific to SpriteSheetAnimation?
    MinSpriteIndex, MaxSpriteIndex, IdleSpriteIndex
  • What does the IsAnimationStopped property do?
    Sets CurrentSpriteIndex to IdleSpriteIndex if true
  • What does the Update method in SpriteSheetAnimation do?
    Calls base.Update and updates the animation
  • What is the purpose of the GameObject class?
    To combine visualization with extra features
  • What is the inheritance structure of GameObject?
    Inherits from System.Object
  • Why is GameObject declared abstract?
    To prevent direct instantiation
  • What property in GameObject represents its visualization?
    Visualization of type SpriteSheet
  • What does the IsActive property control in GameObject?
    Whether the GameObject participates in operations
  • What does the Velocity property in GameObject represent?
    The speed of the GameObject's movement
  • How is IsOutOfBounds calculated?
    Using Visualization properties and GameSettings values
  • What does the Update method in GameObject do?
    Moves the GameObject and updates visualization
  • What is the purpose of the Draw method in GameObject?
    Calls Visualization.Draw if active
  • What does the IsCollidingWith method check?
    If two GameObjects' HitBoxRectangles intersect
  • What are the main responsibilities of the Screen class?
    • Initialize
    • LoadContent
    • Update
    • Draw
  • What is the inheritance structure of the Screen class?
    Inherits from System.Object
  • What is the purpose of the GameSettings class?
    To provide global access to settings
  • What keyword is used to define partial classes in C#?
    partial
  • What is the significance of the static declaration in GameSettings?
    All members must be static as well
  • What properties are defined in GameSettings?
    Dimensions for graphics and screens
  • How does Game1 interact with GameSettings.ActiveScreen?
    Updates and draws the ActiveScreen only
  • What is the purpose of the UserInput class?
    To handle standard user interactions
  • What does the SimpliedTextBox class inherit from?
    TextControl
  • What is the main function of the Button class?
    To allow user interaction through clicks
  • What are the key features of ControlBase?
    • Abstract class
    • Inherits from System.Object
    • Properties: Position, Size, BackgroundColor, StrokeColor
    • Methods: Update, Draw
  • What are the properties of TextControl?
    • Inherits from ControlBase
    • Properties: Text, Font, TextColor
    • Overrides Draw to center text
  • What does the SimpliedTextBox class add to TextControl?
    Logic to change displayed text on key releases
  • What is the relationship between Button and TextControl?
    • Button inherits from TextControl
    • Button adds no new properties or methods