First Enemies and Controller Support


I had a whole article written up and ready to go, but of course when I clicked save the page timed out and I lost an hour + worth of writing...  I don't have the energy to write this blog again, so I'm just going to give a quick summary of this week.  Hopefully short and sweet is alright!

Art

Here are the new enemies Ref the artist has been working on.  We've gone through a lot of iterations and I think they look pretty great!

(I love the way his helmet bounces when he walks!)


(Tank enemy. Slow. Lumbering. Boney)

Controller support

While Ref was working on the enemy I was working on implementing controller support.  

Tech stack:

Architecture:

  • Rewired
    • Handles controller api calls for all possible controllers + mouse and keyboard
    • Emits the last used controller
  • Controller Swap Event
    • A global event emits if we switched from mouse/keyboard to controller or vice versa
  • Controller Manager
    • Uses update function to read whether the last controller used was Mouse/Keyboard or controller.  
    • If they switch, it will enable/disable the mouse cursor and send out the ControllerSwapEvent
  • Virtual Pointer
    • GameObject with a sprite version of the cursor
    • Listens for the controller swap event
    • Globally emits the mouse or controller viewport position so that other parts of the game can use it for aiming
    • When mouse and keyboard is enabled it disables the sprite and lets the unity input.mouse api control the cursor position
    • When the controller is enabled it enables the sprite and lerps it in the direction the joystick is pointing
  •  UI Helper package
    • Controls the current canvas screen (canvas group) that's active and disables the selectable elements on the other ones
    • Listens for the controller swap event.  If it is a controller it automatically focuses on the first selectable element on the canvas group and handles navigation
    • If it's a mouse it defocuses from all elements and lets unity IPointer interfaces handle clicking and selection.

Accessibility

I also wrote a shader that adds outlines to enemies.  It's disabled by default but outlines are now an accessibility feature in the options menu.  Players can enable outlines on enemies and control their color. hopefully this provides more color contrast to players that want it.

(Outline examples)

Last thing I did was make a custom cursor sprite.  Behold my glorious (terrible) art

(It looks exactly like the cursor from 20 minutes till dawn, I know, but I drew it myself!) 

You will also be able to change the cursor color in the options menu now since a common complaint I get was how hard it is to see sometimes!

Looking Forward

Next week I aim to wrap up controller support and go back to playtesting the game and balancing / fixing the later levels! On the art side, I think we will continue to iterate over the remaining enemies for Level 1, and, maybe, start thinking about the first Elite and Boss enemies :0.  I'm both excited and scared to get to that part.

Files

_MasterProjectBuilds.zip 130 MB
Jul 26, 2024

Get Bloodmoon Survivors

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.