How do I make an upper Sprite cover a lower Sprites?

Get help using Construct 2

Post » Mon May 09, 2016 8:05 pm

I am trying to make a top Z order Sprite cover lower Sprites so they are no longer selectable with the mouse or touch.

Basically, I have blocks that are normally selectable that I want to make them impossible to select when a specific Sprite is above them visually. Whether the Sprite is a transparent mask or a solid object.

It seems like using the Z order is the most obvious solution, but I am open to suggestions.
B
47
S
20
G
6
Posts: 120
Reputation: 6,718

Post » Mon May 09, 2016 8:31 pm

Or with an instance variable?

  • System > On start of layout | system > load game from slot "brain"
  • System > On load failed | system > scroll to obj_Forum
B
17
S
8
G
5
Posts: 340
Reputation: 4,707

Post » Mon May 09, 2016 9:36 pm

I'm not sure I understand what you mean. Is that a question or a suggestion?
B
47
S
20
G
6
Posts: 120
Reputation: 6,718

Post » Mon May 09, 2016 11:45 pm

On click, check if the object is overlapped, if so ignore the click.
If you are looking for solutions and workarounds to the Windows 10 C2 performance issues feel free to reach out to me.

Following rexrainbow's lead - Goodbye.
B
50
S
24
G
14
Posts: 632
Reputation: 12,505

Post » Tue May 10, 2016 4:41 pm

Great! I am very new to this so I will try experimenting with Booleans.
B
47
S
20
G
6
Posts: 120
Reputation: 6,718

Post » Tue May 10, 2016 9:44 pm

I am having trouble understanding the Booleans and getting them to function as I would like.

Also, where do I place them? As a condition or an action?
B
47
S
20
G
6
Posts: 120
Reputation: 6,718

Post » Tue May 10, 2016 9:48 pm

You would set the instance variable as an action like is moveable to false
Then you check condition boolean is NOT set (you invert with a right mouse click)

Or you make instance variables with numbers or letters - her you check condition objSprite variable = "moveable"

  • System > On start of layout | system > load game from slot "brain"
  • System > On load failed | system > scroll to obj_Forum
B
17
S
8
G
5
Posts: 340
Reputation: 4,707

Post » Mon May 16, 2016 10:00 pm

I am having the hardest time making something false change to true.

I have the instance variable set to false and I have it named. Where do access the action? It is not available in under 'system'. When 'sprite1' is overlapping 'sprite2', I want the Boolean to change values, but I cannot find the action.
B
47
S
20
G
6
Posts: 120
Reputation: 6,718

Post » Mon May 16, 2016 10:04 pm

You find it in your object_Sprite
it's like that with all instance variables

  • System > On start of layout | system > load game from slot "brain"
  • System > On load failed | system > scroll to obj_Forum
B
17
S
8
G
5
Posts: 340
Reputation: 4,707

Post » Mon May 16, 2016 10:04 pm

Event: Your Upper Object -> Is overlapping another object -> Your Object below
Action: Your Object below -> Toggle Boolean (true)
-> Else: Toggle Boolean (false)

Then take that Boolen as another condition to your touch event, so it only takes place when that boolean is true:
Condition: Your Object below -> Is boolean instance variable set

This condition will check if its true, if you want to check for false you have to invert that condition.
B
23
S
7
G
4
Posts: 154
Reputation: 3,754

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 5 guests