1. 27 Dec, 2020 2 commits
    • Rahix's avatar
      Don't return to heaven immediately · 94fc5be2
      Rahix authored
      Show a banner message that a return to heaven is imminent and count down
      for 3 seconds before going back to heaven.  This makes the game flow
      a bit smoother as it provides an indication to the player that the
      challenge is completed now.
      94fc5be2
    • Simon Goller's avatar
      Framerate and movement fixed · df971876
      Simon Goller authored
      The `Clock` now returns a constant `frame_delta` for each frame.
      To do this, it must be updated once in the `InGameState` on each
      update.
      
      This commit also fixes the diagonal movement speed by normalizing
      the movement vector.
      
      Fixes #19 and #20
      df971876
  2. 26 Dec, 2020 7 commits
    • Rahix's avatar
      bottle-drop: Use a sprite for rendering · 5f075603
      Rahix authored
      Drop the home-cooked temporary debug rendering system for bottle drop
      points and instead use a sprite for this.
      5f075603
    • Rahix's avatar
      sprites: Don't hold center coordinates in component · ff31586d
      Rahix authored
      Query the size of the sprite on the fly during rendering.  This makes
      component instanciation much easier because it no longer requires access
      to the `Rendering` API.
      
      As a later optimization, we could move this ofsetting into the
      draw_image() function via a new parameter.
      ff31586d
    • Grisu's avatar
      Add some obstacles · d32576e3
      Grisu authored and Rahix's avatar Rahix committed
      d32576e3
    • Rahix's avatar
      gamestate: Pass frame timestamp to state update method · b5f95278
      Rahix authored
      Pass the timestamp from requestAnimationFrame() to the state update
      function so the game-state doesn't have to call into JavaScript for
      timestamps anymore.
      b5f95278
    • Rahix's avatar
      resources: Add GameManager · ca343ed9
      Rahix authored
      The GameManager provides a way for systems to schedule a transition back
      to the heaven.
      ca343ed9
    • Rahix's avatar
      Configure shift-specific entities, resources, and systems · 96901f6e
      Rahix authored
      Add a new method to the AngelShiftImpl trait which angel shifts use to
      configure any shift-specific entities, resources, and ECS systems.
      
      As a first implementation, properly implement this for the bottle angel
      shift and move the `collect_bottledrops` systems here instead of it
      being a generic system.
      96901f6e
    • Rahix's avatar
      Pass Player component between gamestates · ff0b5af8
      Rahix authored
      The player component hold information which should stay persistent
      across the game-runs and thus needs to be passed through the different
      game-states.  Do this by instanciating it in the heaven and then passing
      it through the level-loading state into the in-game state.
      ff0b5af8
  3. 25 Dec, 2020 1 commit
    • Simon Goller's avatar
      Fix future memory leak of registered images · fccc526d
      Simon Goller authored and neosam's avatar neosam committed
      Sprites were loaded during the level_loading und the level images in
      InGameState::new() but they were never cleaned up.  As soon as the
      InGameState starts several times, this would lead to a memory leak.
      This commit contains a separate treatment for sprites and the level
      images:
      
      Since sprites are stored as a global Enum, they will now be initialized
      only once on the first loading state.  When loading the images, they
      check if the ImageHandle is already registered on the renderer to
      determine if loading is required.
      
      Level foreground and background on the other hand are dynamically loaded
      in the InGameState.  The InGameState got a new attribute
      `registered_images: Vec<resources::ImageHandle>` which stores all
      `ImageHandle` of dynamically loaded images.  On deinint, they
      get deregistered from `Rendering`.
      fccc526d
  4. 22 Dec, 2020 4 commits
  5. 21 Dec, 2020 8 commits
  6. 19 Dec, 2020 5 commits
  7. 18 Dec, 2020 6 commits
  8. 17 Dec, 2020 4 commits
  9. 14 Dec, 2020 2 commits