2D Platformer – build 007

01 July 2021 gamedev

A melee attack! And cute little doggies to use the attack on 😢. Also I added a UI for testing the Music Manager.

New stuff:

  • A health system, and a basic health bar. I only want the character to have around ~5 units of health, and everything dealing 1 damage. But for now he’s got 100 HP.
  • Traps have knockback.
  • Trying to implement an attack system. First one is a basic melee attack.
    • the game draws a circle at a certain position relative to the player’s facing, and if enemies are within the circle, deal damage and knock them back. TODO: figure out how to render my debug raycasts (like the attack range) into runtime builds so I can toggle this stuff on/off in DevTools.
    • and start an attack animation. I learnt that animations can have ‘layers’ so this attach animation only animates the arm/sword, and additively blends the animation with whatever base animation is playing (idle, running, airborne, crouching, etc). I’m glad I discovered this, it should make improving these animations easier.
  • Some doggies to attack and push into traps (it’s a sprite I had on hand, poor doggies).
  • Killing units sends a message to a centralised Event Bus I made, which instructs an invisible spawner to pop out more doggies.
  • Improvement to the Music Manager - big thanks to ACDev on Youtube. It’s heavily based on his current series about designing a sound management system. The test audio files also come from his channel.
  • I made a UI for easier testing of the Music Manager. Press “9” on keyboard (not numpad) to toggle it on/off.
  • I made a simple FPS counter. It worked fine and was only a few lines of code. Then I wanted to make a cool FPS-over-time graph like some games have… and instead of reinventing the wheel I found Graphy which does it all for me! “0” on keyboard cycles through some modes.
This content does not resize on smaller browser widths. Try using the fullscreen button below (after loading the game).
WebGL builds are not supported on mobile devices.

Controls

Action Keyboard Xbox controller (or other controllers)
Movement A/D, or Left/Right arrows left analogue stick
Jump Space A button (the bottom ‘primary’ button)
Attack E B button (the right ‘primary’ button)
Crouch S or Ctrl left bumper or left trigger
Menu Escape Start
music manager UI 9 none
fps stats 0 none
comments powered by Disqus