Issues With Z Order Of Sprites - Need Some Help!

Get help using Construct 2

Post » Wed Feb 13, 2013 11:16 pm

Issues With Z Order Of Sprites - Need Some Help!

Hi,

My Asteroids remake is progressing well
with the help I receive in this forum.

I have a display problem with my sprites:
When an asteroid is blasted I display a fading explosion sprite.
Problem is the the new smaller asteroids
are being drawn above the explosion
and I cant seem to fix this using "Z Order" commands in the IDE.

Here is a URL link to the current stable project:
http://16bitsoft.com/V2/Files/RocksInSpace/Alpha3/RocksInSpace_Alpha3a.capx

Here is a screenshot of the issue:


Hope someone can help, thanks!

JeZ+Lee
B
11
S
3
G
4
Posts: 105
Reputation: 2,950

Post » Wed Feb 13, 2013 11:29 pm

I believe it's because they are spawned after the explosion ,
You can fix it by setting an event like this ...

" On Every Ticks | Explosion : Move to top "

Cheers !Whiteclaws2013-02-13 23:29:33
B
35
S
16
G
16
Posts: 2,222
Reputation: 16,589

Post » Wed Feb 13, 2013 11:37 pm

[QUOTE=Whiteclaws] I believe it's because they are spawned after the explosion ,
You can fix it by setting an event like this ...

" On Every Ticks | Explosion : Move to top "

Cheers ![/QUOTE]Hi,

That worked perfectly, thanks!

JeZ+Lee
B
11
S
3
G
4
Posts: 105
Reputation: 2,950

Post » Wed Feb 13, 2013 11:48 pm

That seems like a waste of processor using every tick. Do something like is explosion onscreen trigger once move to top.
B
68
S
21
G
15
Posts: 701
Reputation: 15,604

Post » Thu Feb 14, 2013 12:49 am

Or put it in the event that spawns the explosion:

Create Explosion
Explosion move to top...

Sorry if my pseudo code doesn't match up, I am on a tablet without construct in front of me....
B
49
S
11
G
10
Posts: 1,833
Reputation: 14,428

Post » Thu Feb 14, 2013 1:13 am

@lanceal ,
1 event shouldn't waste much CPU
and it's the easiest way to do it
B
35
S
16
G
16
Posts: 2,222
Reputation: 16,589

Post » Thu Feb 14, 2013 1:19 am

Hi,

I've completed and released Alpha 3c here:
http://www.scirra.com/forum/topic63317.html
Was hoping someone could play it and provide suggestions for improvement?
Thanks!

JeZ+Lee
B
11
S
3
G
4
Posts: 105
Reputation: 2,950


Return to How do I....?

Who is online

Users browsing this forum: austinblackbelt and 14 guests