Keeper Keeper fresh devlog!
This week I worked on adding an on/off toggle button for the keep. It’s not done yet, but it’s getting close. The keep can be turned on and off, and when off it prevents players and the ball from going into the keep or getting points. However, the sprites aren’t in it yet and neither is the button the player will push to toggle this on or off. Basically, it’s almost completely functional, but you can’t see it, thus no new download this week.
Constructing the Keep Toggler
Alrighty, so what’s happening with the keep toggler? How does it work? Right now, in Unity’s Hierarchy is a GameObject for each keep, and on that keep are a couple booleans that can be turned on or off. Those booleans tell all the keep’s children what “features” are currently active, like the bumpers or toggle.
If the bumpers are active, they allow the keep to slide back and forth along the wall when you push it. The bumpers have to make sure there’s something for you to bump into, so they turn on some colliders you or ball can push against. When you run into the bumpers, the entire goal is moved along a Slider Joint on the wall. There’s probably a better way to do this, but it’s working great for now.
If the toggle is active, the keep behaves as if it’s closed. The back wall of the keep moves forward, flush with the arena wall, and for good measure the keep loses the ability to tell if the ball is in it. This prevents you from accidentally getting points from an “off” keep, just in case.
Keeps can have multiple of these features turned on or off at once, making it slow to test and make sure that everything is playing nicely together. I ran into problems when I started the game with both the bumpers and toggle enabled, but it was fine if they both started off and were turned on after the game began. To fix this, I switched the toggler to change the GameObject’s tag to something other than what the ball checks for to see if it got a point (like it invisible), when before it turned off the collider with the tag the ball is looking for. When the collider was being turned on and off, the physics system thought the keep needed to be moved to the middle of the arena. Obviously that was no good. Changing the tag was a much “safer” way to prevent the ball from scoring on that keep.
Working with Unity’s built in physics system makes development really convenient most of the time, but it get’s pretty complicated when you’re essentially hot-swapping components. You have to be extremely careful when setting up these sorts of interactions, and test every conceivable combination of starting state or in game modification. Luckily, the toggle and bumpers are now working great, and they’re getting close to being done.
The toggle isn’t quite done, and aside from adding visual feedback, I’ll be adding a button that can be pushed by the player to toggle the keep on or off. Right now I’m toggling a keep on or off by checking a box in Unity’s Inspector.
- Ability to win and reset the game.
- Player abilities (grab and shoot).
- Bug fixes forever.
- Complete animations for keeps, players, the ball, and UI.
- Sound effects and music.
- Additional arena designs.
- Main menu, including settings and controls overview.
- Game mode, player, and arena select.
- Four player support.
- Game cabinet!
Get Keeper Keeper
Leave a comment
Log in with itch.io to leave a comment.