PyramidPanic - Feature - HealthBars, PopUps and HUD

in #utopian-io8 years ago (edited)

PyramidPanic.png

Overview

Visual elements can make or break a game. They keep the players informed and allow for the game to communicate information to the player directly. However, doing so in a way that does not distract the player or break away from player immersion can be difficult. When developing the interfaces below, conscious effort was put into keeping each element simple, and only showing it to players when they needed to know it, rather than flood the screen with excess information.


HealthBars

Health Bars are a common visual way to denote the current state of a player or characters health. Health bars are available on all player or enemy objects. Every game object which has the "CharacterController" component added have a health bar by default which is hooked up through the CharacterControllers method that is invoked on taking damage.

CharacterControllers communicate with their appropriate HealthBar through the MessageManager messaging system, allowing for decoupled communication.


HealthBar.png

HealthBar Game Object

The HealthBar.cpp class is a ComplexSprite game object, which means it is a game object which utilizes a sprite sheet. On creation, its setTrackingPlayer method is invoked, notifying it which player to track. Tracked players are following on the HealthBars update method, and have the HealthBar subscribe for events regarding that player being hurt.

HealthBars only become visible when damage is inflicted on a character, telling a player that their health has been updated to the now-visible amount. After a few seconds of not taking damage, healthbars disappear, clearing the screen of excess clutter.

Created
Modified
HealthBar.cpp
CharacterController.cpp
SpawnManager.cpp

Position Based Pop Ups

Position based pop ups are HUD elements which selectively appear when a player approaches an interactable object in the world. These pop ups will appear when a player approaches, and disappear when they leave the range. Objects which create PopUp messages will be objects such as doors, which will tell the player to open/close the doors, or weapons which will tell a player how to pick them up. Future invokable objects will also use the system, such as the end game Throne.


PopUps.png

PositionBasedPopUp Game Object

The PositionBasedPopup.cpp class is a SimpleSprite game object, which means it uses a single sprite with no animations. On creation, it is given an object to track and a max distance that object can be from the given x/y position. onUpdate, the object checks if the distance between the objects has reached the limit. Once it has, the popup destroys itself.

Created
Modified
PositionBasedPopup.cpp
Door.cpp
WorldItem.cpp

Exit Game HUD

Menu dialogues to confirm ending a game session is a simply but important task. Rather than exiting with a simple key stroke, confirming the users intentions is important. Rather than create a game object for this, the logic is handled by the scene itself.


ExitGame.png

The NetworkedGameScene.cpp file in the onUpdate method now handles a proper end game prompt. If a user presses the escape key, a prompt appears telling the user to press Enter to confirm quitting or Escape to close the message. As the prompt image itself needs no customized logic, it is simply a MiscSquare game object with a given sprite to display. The scene handles the creation and deletion of this menu prompt.

Modified

NetworkedGameScene.cpp


Assets

exitNow.png
healthBarSheet.png
popupActive.png
popupPickup.png



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

It's interesting to read your thoughts on why the implementation of the visual effects was made in a particular way, rather than just what the changes were and how they were implemented. It makes for a more interesting contribution, something which can be a challenge when talking about development. Food for thought!

Thanks for the feedback. I'll definitely explain decisions more in the future. I'm not sure why I don't, I suppose my utopian posts are more factual while my development blogs are more opinion based, however I don't do development blogs on my games so I don't really give that info anywhere.

I'll explain "why" from now on more :)

Congratulations! This post has been upvoted from the communal account, @minnowsupport, by carsonroscoe from the Minnow Support Project. It's a witness project run by aggroed, ausbitbank, teamsteem, theprophet0, someguy123, neoxian, followbtcnews, and netuoso. The goal is to help Steemit grow by supporting Minnows. Please find us at the Peace, Abundance, and Liberty Network (PALnet) Discord Channel. It's a completely public and open space to all members of the Steemit community who voluntarily choose to be there.

If you would like to delegate to the Minnow Support Project you can do so by clicking on the following links: 50SP, 100SP, 250SP, 500SP, 1000SP, 5000SP.
Be sure to leave at least 50SP undelegated on your account.

Hey @carsonroscoe! Thank you for the great work you've done!

We're already looking forward to your next contribution!

Fully Decentralized Rewards

We hope you will take the time to share your expertise and knowledge by rating contributions made by others on Utopian.io to help us reward the best contributions together.

Utopian Witness!

Vote for Utopian Witness! We are made of developers, system administrators, entrepreneurs, artists, content creators, thinkers. We embrace every nationality, mindset and belief.

Want to chat? Join us on Discord https://discord.me/utopian-io

Congratulations @carsonroscoe! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

Award for the number of comments received

Click on any badge to view your own Board of Honor on SteemitBoard.
For more information about SteemitBoard, click here

If you no longer want to receive notifications, reply to this comment with the word STOP

Upvote this notification to help all Steemit users. Learn why here!

Thanks for the contribution. It has been approved.


Need help? Write a ticket on https://support.utopian.io.
Chat with us on Discord.

[utopian-moderator]

Loading...

Coin Marketplace

STEEM 0.04
TRX 0.33
JST 0.102
BTC 65258.47
ETH 1901.09
USDT 1.00
SBD 0.38