How do I create a HUD to select actions and cycle characters

Get help using Construct 2

Post » Sun May 17, 2015 8:38 am

Hi,

I saw the Shapeshifter game by @zathan and really liked the HUD that pops up when you hold space to shift the shapes.

Image

I would like to implement similar mechanism to select contextual actions and show character overlays when cycling between characters. I understand how I can spawn an object in front of my Player or at a specific postion on keystorkes. But how do I pause the background and use the arrow keys to cycle through my options.
B
26
S
1
Posts: 59
Reputation: 1,100

Post » Sun May 17, 2015 12:26 pm

This can easily be done by using game states. I recommend you read about the state pattern in programming http://en.wikipedia.org/wiki/State_pattern

In construct 2 you can do it by creating a variable named "state", set it to (for example) "playing" on start, and to "shapeshifting" when the player is in the contextual menu.

Use this variable to change the behavior of keystrokes, for example, if "state=playing" and left key is down, do this, and when "state = shapeshifting" and left key is down, do that.

I use game states a lot and I think it is very easy once you break it down to simple states. Good luck.
ImageImage
B
44
S
14
G
10
Posts: 166
Reputation: 7,779

Post » Mon May 18, 2015 4:56 pm

Thanks for the tip Zed2100,

I've made a couple of player state guess game state might help with this.
B
26
S
1
Posts: 59
Reputation: 1,100


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 16 guests